diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d8d9cf2..f6fd63f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -45,44 +45,50 @@ kotlin { } } -compose.desktop { - application { - mainClass = "warlockfe.warlock3.app.MainKt" +compose { + desktop { + application { + mainClass = "warlockfe.warlock3.app.MainKt" - nativeDistributions { - targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) - packageName = "warlock3" - packageVersion = project.version.toString() - modules("java.naming") - copyright = "Copyright 2024 Sean Proctor" - licenseFile.set(project.file("../LICENSE")) - description = "Warlock Front-end" - vendor = "Warlock Project" + nativeDistributions { + targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) + packageName = "warlock3" + packageVersion = project.version.toString() + modules("java.naming") + copyright = "Copyright 2024 Sean Proctor" + licenseFile.set(project.file("../LICENSE")) + description = "Warlock Front-end" + vendor = "Warlock Project" - windows { - menu = true - // see https://wixtoolset.org/documentation/manual/v3/howtos/general/generate_guids.html - upgradeUuid = "939087B2-4E18-49D1-A55C-1F0BFB116664" - } - macOS { - bundleID = "warlockfe.warlock3" - signing { - sign.set(true) - identity.set("Sean Proctor") + windows { + menu = true + // see https://wixtoolset.org/documentation/manual/v3/howtos/general/generate_guids.html + upgradeUuid = "939087B2-4E18-49D1-A55C-1F0BFB116664" } - notarization { - appleID.set("sproctor@gmail.com") - password.set(providers.environmentVariable("NOTARY_PWD")) - teamID.set("DBNJ4AR55X") + macOS { + bundleID = "warlockfe.warlock3" + signing { + sign.set(true) + identity.set("Sean Proctor") + } + notarization { + appleID.set("sproctor@gmail.com") + password.set(providers.environmentVariable("NOTARY_PWD")) + teamID.set("DBNJ4AR55X") + } } } - } - buildTypes.release.proguard { - version.set("7.6.0") - configurationFiles.from("rules.pro") + buildTypes.release.proguard { + version.set("7.6.0") + configurationFiles.from("rules.pro") + } } } + + resources { + packageOfResClass = "warlockfe.warlock3.app.resources" + } } // region Work around temporary Compose bugs. diff --git a/app/src/main/composeResources/drawable/icon.png b/app/src/main/composeResources/drawable/icon.png new file mode 100644 index 0000000..3fd16d0 Binary files /dev/null and b/app/src/main/composeResources/drawable/icon.png differ diff --git a/app/src/main/kotlin/warlockfe/warlock3/app/AboutDialog.kt b/app/src/main/kotlin/warlockfe/warlock3/app/AboutDialog.kt index 2fca90b..7f7d7f8 100644 --- a/app/src/main/kotlin/warlockfe/warlock3/app/AboutDialog.kt +++ b/app/src/main/kotlin/warlockfe/warlock3/app/AboutDialog.kt @@ -13,14 +13,14 @@ import androidx.compose.foundation.layout.width import androidx.compose.material3.Button import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.toComposeImageBitmap import androidx.compose.ui.unit.dp import androidx.compose.ui.window.DialogWindow import androidx.compose.ui.window.rememberDialogState -import org.jetbrains.skia.Image +import org.jetbrains.compose.resources.painterResource +import warlockfe.warlock3.app.resources.Res +import warlockfe.warlock3.app.resources.icon @Composable fun AboutDialog( @@ -34,11 +34,11 @@ fun AboutDialog( ) { Column(Modifier.padding(16.dp)) { Row(Modifier.fillMaxWidth()) { - val image = remember { - Image.makeFromEncoded( - javaClass.getResourceAsStream("/images/icon.png")!!.readBytes() - ).toComposeImageBitmap() } - Image(modifier = Modifier.size(48.dp), bitmap = image, contentDescription = "Warlock logo") + Image( + modifier = Modifier.size(50.dp), + painter = painterResource(Res.drawable.icon), + contentDescription = "Warlock logo", + ) Spacer(Modifier.width(16.dp)) Column { Text("Warlock 3")