Adaptive Layout (WIP)
This commit is contained in:
@@ -25,7 +25,7 @@ kotlin {
|
||||
|
||||
compose.desktop {
|
||||
application {
|
||||
mainClass = "MainKt"
|
||||
mainClass = "ch.dissem.yaep.ui.desktop.MainKt"
|
||||
|
||||
nativeDistributions {
|
||||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
||||
|
||||
@@ -94,16 +94,16 @@ fun AppBar(
|
||||
Icon(
|
||||
painter = painterResource(
|
||||
if (useDarkMode) {
|
||||
CRes.drawable.sun
|
||||
} else {
|
||||
CRes.drawable.moon
|
||||
} else {
|
||||
CRes.drawable.sun
|
||||
}
|
||||
),
|
||||
contentDescription = stringResource(
|
||||
if (useDarkMode) {
|
||||
CRes.string.use_light_mode
|
||||
} else {
|
||||
CRes.string.use_dark_mode
|
||||
} else {
|
||||
CRes.string.use_light_mode
|
||||
}
|
||||
),
|
||||
modifier = Modifier.size(SwitchDefaults.IconSize),
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package ch.dissem.yaep.ui.desktop
|
||||
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
@@ -18,8 +20,6 @@ import ch.dissem.yaep.domain.Game
|
||||
import ch.dissem.yaep.domain.generateGame
|
||||
import ch.dissem.yaep.ui.common.App
|
||||
import ch.dissem.yaep.ui.common.theme.emojiFontFamily
|
||||
import ch.dissem.yaep.ui.desktop.AppBar
|
||||
import ch.dissem.yaep.ui.desktop.DesktopWindow
|
||||
import org.jetbrains.compose.resources.painterResource
|
||||
import org.jetbrains.compose.resources.stringResource
|
||||
import yaep.commonui.generated.resources.app_name
|
||||
@@ -27,7 +27,7 @@ import yaep.desktop.generated.resources.ic_launcher
|
||||
import yaep.commonui.generated.resources.Res as CRes
|
||||
import yaep.desktop.generated.resources.Res as DRes
|
||||
|
||||
fun main() = application {
|
||||
fun main(): Unit = application {
|
||||
emojiFontFamily = FontFamily(
|
||||
Font(
|
||||
resource = "NotoColorEmoji-Regular.ttf",
|
||||
@@ -37,7 +37,7 @@ fun main() = application {
|
||||
)
|
||||
val windowState = rememberWindowState(
|
||||
placement = WindowPlacement.Floating,
|
||||
size = DpSize(1200.dp, 800.dp)
|
||||
size = DpSize(1250.dp, 800.dp)
|
||||
)
|
||||
var game by remember { mutableStateOf<Game>(generateGame()) }
|
||||
|
||||
@@ -58,7 +58,8 @@ fun main() = application {
|
||||
setDarkMode = { useDarkMode = it },
|
||||
onCloseRequest = ::exitApplication,
|
||||
onRestart = {
|
||||
do while (game.grid.undo());
|
||||
@Suppress("ControlFlowWithEmptyBody")
|
||||
do /* nothing */ while (game.grid.undo())
|
||||
resetCluesBeacon = Any()
|
||||
},
|
||||
windowState = windowState,
|
||||
|
||||
Reference in New Issue
Block a user