diff --git a/templates/desktop-template/build.gradle.kts b/templates/desktop-template/build.gradle.kts index 9255c3f0da3..823a79ae076 100644 --- a/templates/desktop-template/build.gradle.kts +++ b/templates/desktop-template/build.gradle.kts @@ -5,7 +5,7 @@ plugins { // __KOTLIN_COMPOSE_VERSION__ kotlin("jvm") version "1.5.21" // __LATEST_COMPOSE_RELEASE_VERSION__ - id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.5.0-build262") + id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.0.0-sync-2021-07-23-build267") } repositories { diff --git a/templates/desktop-template/src/main/kotlin/main.kt b/templates/desktop-template/src/main/kotlin/main.kt index 85d8b042964..3c1383e436d 100644 --- a/templates/desktop-template/src/main/kotlin/main.kt +++ b/templates/desktop-template/src/main/kotlin/main.kt @@ -1,4 +1,3 @@ -import androidx.compose.desktop.Window import androidx.compose.material.Text import androidx.compose.material.Button import androidx.compose.material.MaterialTheme @@ -6,15 +5,19 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.window.Window +import androidx.compose.ui.window.application -fun main() = Window { - var text by remember { mutableStateOf("Hello, World!") } +fun main() = application { + Window(onCloseRequest = ::exitApplication) { + var text by remember { mutableStateOf("Hello, World!") } - MaterialTheme { - Button(onClick = { - text = "Hello, Desktop!" - }) { - Text(text) + MaterialTheme { + Button(onClick = { + text = "Hello, Desktop!" + }) { + Text(text) + } } } } diff --git a/templates/multiplatform-template/build.gradle.kts b/templates/multiplatform-template/build.gradle.kts index 7114839f1cb..a85f8115c8b 100644 --- a/templates/multiplatform-template/build.gradle.kts +++ b/templates/multiplatform-template/build.gradle.kts @@ -1,6 +1,6 @@ buildscript { // __LATEST_COMPOSE_RELEASE_VERSION__ - val composeVersion = System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.5.0-build262" + val composeVersion = System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.0.0-sync-2021-07-23-build267" repositories { google() diff --git a/templates/multiplatform-template/desktop/src/jvmMain/kotlin/main.kt b/templates/multiplatform-template/desktop/src/jvmMain/kotlin/main.kt index c810ea3d8bd..2543564b01e 100644 --- a/templates/multiplatform-template/desktop/src/jvmMain/kotlin/main.kt +++ b/templates/multiplatform-template/desktop/src/jvmMain/kotlin/main.kt @@ -1,5 +1,8 @@ -import androidx.compose.desktop.Window +import androidx.compose.ui.window.Window +import androidx.compose.ui.window.application -fun main() = Window { - App() +fun main() = application { + Window(onCloseRequest = ::exitApplication) { + App() + } } \ No newline at end of file