diff --git a/build.gradle.kts b/build.gradle.kts index 2a9c4ebb..d8430fd2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -67,8 +67,8 @@ compose.desktop { targetFormats(TargetFormat.Dmg) - packageName = "Kotlin Explorer" packageVersion = "1.1.0" + packageName = "Kotlin Explorer" description = "Kotlin Explorer" vendor = "Romain Guy" licenseFile = rootProject.file("LICENSE") @@ -76,6 +76,7 @@ compose.desktop { macOS { dockName = "Kotlin Explorer" bundleID = "dev.romainguy.kotlin.explorer" + iconFile = file("icons/jewel.icns") } } } diff --git a/src/jvmMain/kotlin/dev/romainguy/kotlin/explorer/KotlinExplorer.kt b/src/jvmMain/kotlin/dev/romainguy/kotlin/explorer/KotlinExplorer.kt index 91191377..2d401c93 100644 --- a/src/jvmMain/kotlin/dev/romainguy/kotlin/explorer/KotlinExplorer.kt +++ b/src/jvmMain/kotlin/dev/romainguy/kotlin/explorer/KotlinExplorer.kt @@ -551,50 +551,54 @@ private fun RSyntaxTextArea.updateStyle(explorerState: ExplorerState) { } @OptIn(ExperimentalJewelApi::class) -fun main() = application { - // Faster scrolling in Swing components - enableNewSwingCompositing() +fun main() { + System.setProperty("apple.awt.application.name", "Kotlin Explorer") - val explorerState = remember { ExplorerState() } + application { + // Faster scrolling in Swing components + enableNewSwingCompositing() - val windowState = rememberWindowState( - size = explorerState.getWindowSize(), - position = explorerState.getWindowPosition(), - placement = explorerState.windowPlacement, - ) + val explorerState = remember { ExplorerState() } - Runtime.getRuntime().addShutdownHook(Thread { - shutdown(explorerState, windowState) - }) + val windowState = rememberWindowState( + size = explorerState.getWindowSize(), + position = explorerState.getWindowPosition(), + placement = explorerState.windowPlacement, + ) - val themeDefinition = if (KotlinExplorerTheme.System.isDark()) { - JewelTheme.darkThemeDefinition() - } else { - JewelTheme.lightThemeDefinition() - } - val titleBarStyle = if (KotlinExplorerTheme.System.isDark()) { - TitleBarStyle.dark() - } else { - TitleBarStyle.light() - } + Runtime.getRuntime().addShutdownHook(Thread { + shutdown(explorerState, windowState) + }) - IntUiTheme( - themeDefinition, - ComponentStyling.decoratedWindow(titleBarStyle = titleBarStyle), - false - ) { - DecoratedWindow( - state = windowState, - onCloseRequest = { - explorerState.setWindowState(windowState) - exitApplication() - }, - title = "Kotlin Explorer" + val themeDefinition = if (KotlinExplorerTheme.System.isDark()) { + JewelTheme.darkThemeDefinition() + } else { + JewelTheme.lightThemeDefinition() + } + val titleBarStyle = if (KotlinExplorerTheme.System.isDark()) { + TitleBarStyle.dark() + } else { + TitleBarStyle.light() + } + + IntUiTheme( + themeDefinition, + ComponentStyling.decoratedWindow(titleBarStyle = titleBarStyle), + false ) { - TitleBar(Modifier.newFullscreenControls()) { - Text("Kotlin Explorer") + DecoratedWindow( + state = windowState, + onCloseRequest = { + explorerState.setWindowState(windowState) + exitApplication() + }, + title = "Kotlin Explorer" + ) { + TitleBar(Modifier.newFullscreenControls()) { + Text("Kotlin Explorer") + } + KotlinExplorer(explorerState) } - KotlinExplorer(explorerState) } } }