Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
X1nto committed Aug 28, 2022
1 parent 14cb43d commit c3fc6b2
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions example/src/jvmMain/kotlin/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,40 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.application
import java.awt.TextArea

@Composable
fun App(
isDark: Boolean,
requestThemeChange: () -> Unit,
requestThemeChange: (dark: Boolean) -> Unit,
) {
FluentExampleTheme(isDark = isDark) {
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.spacedBy(4.dp, Alignment.CenterVertically),
horizontalAlignment = Alignment.CenterHorizontally
) {
ToggleSwitch(
toggled = isDark,
onToggle = { requestThemeChange() },
RadioGroupColumn(
header = {
Text("Theme")
},
textBefore = {
}
) {
RadioButton(
selected = !isDark,
onSelect = {
requestThemeChange(false)
}
) {
Text("Light")
},
textAfter = {
}
RadioButton(
selected = isDark,
onSelect = {
requestThemeChange(true)
}
) {
Text("Dark")
}
)
}
}
}
}
Expand All @@ -45,8 +53,8 @@ fun main() = application {
) {
App(
isDark = isDark,
requestThemeChange = {
isDark = !isDark
requestThemeChange = { dark ->
isDark = dark
}
)
}
Expand Down

0 comments on commit c3fc6b2

Please sign in to comment.