Skip to content

Commit

Permalink
update icon in about dialog, fixes crash referencing old icon
Browse files Browse the repository at this point in the history
  • Loading branch information
sproctor committed Jan 16, 2025
1 parent de562f1 commit b1b4214
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 38 deletions.
66 changes: 36 additions & 30 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Binary file added app/src/main/composeResources/drawable/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions app/src/main/kotlin/warlockfe/warlock3/app/AboutDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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")
Expand Down

0 comments on commit b1b4214

Please sign in to comment.