From b1b4214b3301f1c1bf00dcf93a20387609af1714 Mon Sep 17 00:00:00 2001 From: Sean Proctor Date: Thu, 16 Jan 2025 18:48:44 -0500 Subject: [PATCH] update icon in about dialog, fixes crash referencing old icon --- app/build.gradle.kts | 66 ++++++++++-------- .../main/composeResources/drawable/icon.png | Bin 0 -> 4474 bytes .../warlockfe/warlock3/app/AboutDialog.kt | 16 ++--- 3 files changed, 44 insertions(+), 38 deletions(-) create mode 100644 app/src/main/composeResources/drawable/icon.png diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d8d9cf21..f6fd63fa 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 0000000000000000000000000000000000000000..3fd16d08ecee7b0a546026c5f931faa099983640 GIT binary patch literal 4474 zcmV-=5ryuFP)EX>4Tx04R}tkv&MmP!xqvQ$>*$2Rn!;WT;MdQIU?d3Pq?8YK2xEOkVm2O&XFE z7e~Rh;NZ_<)xpJCR|i)?5c~mg7n~Gbq{RD@LW>wLJl@B7_Z;544-lGFrdd4+K+|nA zlS+!Y{HoaZiU2|gBaShdS;m|srQus&_tZ^w7vov}eScP1Em#Z)h{OqIm^SeS@$9B; zaNZ}5u(GTYpA%1-bV1@rt}7nDaW1(m@XUyr&CC-=h{aMDD_zXWrbawN991=)@`aqo zD(5ZETD8vF_v9}O74(&5uG1Pt3X52R1Q81AsGtfPG1_%fEM(|B>Ej=9{Svtpa#g^{ zv49#h$gUs!4}Q(Ud*lat9cGGGtSBr64V#SOnhB=$rDu&@C{q=FP2rj?)JqOS4Mf00)P_ zM2WK3ecs*QJ-2^*+VlGXwOMk(+toBz00006VoOIv0RI600RN!9r;`8x010qNS#tmY z4#WTe4#WYKD-Ig~000McNliru=>ZH6BrP>Uj0^w(4|hpKK~!ko&6;VHoK=~}fA_7o z_O7n3^u8yZbe3)cq0>MJAR&NJmJkv3AdaBU2+ACp%nU@q!R6?I%!nKhI)LaHhBMJo z84+0=BS8X@bizqUI^EfN-@B`8-{0ll`B2@U6PaO6s899fz4!Um{r{i)JkMK#Q~Bxa z3~^#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=u2}dPG)=O8`4SvL5Kk!-f=s6PWKP;dtP~B-($@f$;Q2x)>=G$A%Q;E?-g0^HVx0PI`4Pf58<^tSC5a z#+6Ayn#`CPP!hWsGUu#Falx8neCLs~QP|`Qv&2&qMB|4stTb*n`^QT!x`*1pllg^Yee^vo+*LY^4 zj90(YN!?W!P%I4v`IPr^SM?oEO)pLv1+RHUo4>N>B$l-erpyeIqDRD>xdn(^b literal 0 HcmV?d00001 diff --git a/app/src/main/kotlin/warlockfe/warlock3/app/AboutDialog.kt b/app/src/main/kotlin/warlockfe/warlock3/app/AboutDialog.kt index 2fca90b1..7f7d7f83 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")