diff --git a/common/src/commonMain/resources/MR/base/strings.xml b/common/src/commonMain/resources/MR/base/strings.xml index c0949926..511a3822 100644 --- a/common/src/commonMain/resources/MR/base/strings.xml +++ b/common/src/commonMain/resources/MR/base/strings.xml @@ -2,8 +2,11 @@ OK Close + Quit Yes No + + Show Keyguard Name Account name diff --git a/desktopApp/src/jvmMain/kotlin/com/artemchep/keyguard/Main.kt b/desktopApp/src/jvmMain/kotlin/com/artemchep/keyguard/Main.kt index 35c2bc97..ded48e8a 100644 --- a/desktopApp/src/jvmMain/kotlin/com/artemchep/keyguard/Main.kt +++ b/desktopApp/src/jvmMain/kotlin/com/artemchep/keyguard/Main.kt @@ -204,6 +204,12 @@ fun main() { val isWindowOpenState = remember { mutableStateOf(true) } + val onWindowOpen = remember(isWindowOpenState) { + // lambda + { + isWindowOpenState.value = true + } + } // Show a tray icon and allow the app to be collapsed into // the tray on supported platforms. @@ -222,12 +228,14 @@ fun main() { Tray( icon = painterResource(Res.images.ic_keyguard), state = trayState, - onAction = { - isWindowOpenState.value = true - }, + onAction = onWindowOpen, menu = { Item( - stringResource(Res.strings.close), + stringResource(Res.strings.show_keyguard), + onClick = onWindowOpen, + ) + Item( + stringResource(Res.strings.quit), onClick = ::exitApplication, ) },