I want to change the icon for for my compose-desktop app but according to the readme I need to chang...
r
I want to change the icon for for my compose-desktop app but according to the readme I need to change the icon in the build.gradle file. Is it referring to the build.gradle.kts file?
👌 1
k
Copy code
compose.desktop {
    application {
        nativeDistributions {
            targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
            macOS {
                iconFile.set(project.file("icon.icns"))
            }
            windows {
                iconFile.set(project.file("icon.ico"))
            }
            linux {
                iconFile.set(project.file("icon.png"))
            }
        }
    }
}
Copy code
fun start() = application {

    val icon = painterResource("icon.png")

    androidx.compose.ui.window.Window(
        icon = icon,
    ) {
    ...
    }

}
configure gradle to have app icon plus set you icon in
Window
to have proper image in for example windows taskbar
for gradle I putted icons on module level, and for app code in resources
r
Got it thanks. it worked.
2335 Views