diff --git a/desktop/src/main/kotlin/Main.kt b/desktop/src/main/kotlin/Main.kt index b0cad68..d0d8cc1 100644 --- a/desktop/src/main/kotlin/Main.kt +++ b/desktop/src/main/kotlin/Main.kt @@ -6,6 +6,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.window.Tray import androidx.compose.ui.window.Window import androidx.compose.ui.window.application +import androidx.compose.ui.window.isTraySupported import androidx.compose.ui.window.rememberTrayState import com.wbrawner.pihelper.shared.* import com.wbrawner.pihelper.shared.State @@ -121,11 +122,15 @@ fun main() = application { } ) - if (isOpen) { + if (!isTraySupported || isOpen) { Window( title = "Pi-helper", onCloseRequest = { - isOpen = false + if (isTraySupported) { + isOpen = false + } else { + exitApplication() + } }) { App(state) } diff --git a/gradle.properties b/gradle.properties index 2ae54a4..23339e0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,3 @@ android.useAndroidX=true android.enableJetifier=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official - -kotlin.mpp.enableGranularSourceSetsMetadata=true -kotlin.native.enableDependencyPropagation=false -org.jetbrains.compose.experimental.uikit.enabled=true \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 18e4eba..d25cbd6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,13 +4,13 @@ androidx-appcompat = "1.6.1" androidx-splash = "1.0.1" androidx-test-runner = "1.5.2" androidx-test-orchestrator = "1.4.2" -compose = "1.5.0" +compose = "1.6.0" compose-compiler = "1.4.2" compose-material = "1.5.0" compose-material3 = "1.1.1" espresso = "3.5.1" hilt-android = "2.44" -kotlin = "1.9.10" +kotlin = "1.9.22" kotlinx-serialization = "1.4.1" kotlinx-coroutines = "1.6.4" kotlinx-datetime = "0.4.0" @@ -36,7 +36,7 @@ compose-activity = { module = "androidx.activity:activity-compose", version = "1 compose-material = { module = "androidx.compose.material:material", version.ref = "compose-material" } compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" } compose-material3-window = { module = "androidx.compose.material3:material3-window-size-class", version.ref = "compose-material3" } -compose-plugin-jetbrains = { module = "org.jetbrains.compose:compose-gradle-plugin", version = "1.5.0-rc04" } +compose-plugin-jetbrains = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "compose" } compose-test-junit = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" } compose-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose" } compose-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" } @@ -78,4 +78,4 @@ test-ext = { module = "androidx.test.ext:junit", version = "1.1.5" } [bundles] compose = ["compose-ui", "compose-material", "compose-material3", "compose-material3-window", "compose-tooling", "compose-activity", "navigation-compose"] coroutines = ["kotlinx-coroutines-core", "kotlinx-coroutines-android"] -plugins = ["android-gradle", "compose-plugin-jetbrains", "kotlin-gradle", "dagger-hilt", "kotlin-serialization"] \ No newline at end of file +plugins = ["android-gradle", "compose-plugin-jetbrains", "kotlin-gradle", "dagger-hilt", "kotlin-serialization"] diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 103c262..08781fa 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip diff --git a/shared/src/commonMain/kotlin/com/wbrawner/pihelper/shared/ui/component/LoadingSpinner.kt b/shared/src/commonMain/kotlin/com/wbrawner/pihelper/shared/ui/component/LoadingSpinner.kt index bcea158..8dfaf62 100644 --- a/shared/src/commonMain/kotlin/com/wbrawner/pihelper/shared/ui/component/LoadingSpinner.kt +++ b/shared/src/commonMain/kotlin/com/wbrawner/pihelper/shared/ui/component/LoadingSpinner.kt @@ -8,6 +8,7 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.draw.rotate import androidx.compose.ui.graphics.ColorFilter +import org.jetbrains.compose.resources.DrawableResource import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.compose.resources.painterResource @@ -26,7 +27,7 @@ fun LoadingSpinner(animate: Boolean = false) { ) Image( modifier = Modifier.rotate(if (animate) rotation else 0f), - painter = painterResource("img/ic_app_logo.xml"), + painter = painterResource(DrawableResource("img/ic_app_logo.xml")), contentDescription = "Loading", colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onBackground) )