|
@@ -26,70 +26,47 @@ fun main() = application(
|
|
|
val menuState = rememberVisibilityState()
|
|
val menuState = rememberVisibilityState()
|
|
|
|
|
|
|
|
val handleMenuFocus: (Boolean) -> Unit = { focus ->
|
|
val handleMenuFocus: (Boolean) -> Unit = { focus ->
|
|
|
- if (!menuState.isWindowFocus && !focus && !controlCenterState.isWindowFocus) {
|
|
|
|
|
|
|
+ if (!focus) {
|
|
|
menuState.hide()
|
|
menuState.hide()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- val handlePanelFocus: (Boolean) -> Unit = { //focus ->
|
|
|
|
|
-// if (focus) {
|
|
|
|
|
-// if (menuState.isVisible) {
|
|
|
|
|
-// menuState.hide()
|
|
|
|
|
-// }
|
|
|
|
|
-// if (controlCenterState.isVisible) {
|
|
|
|
|
-// controlCenterState.hide()
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// val somethingVisible = menuState.isVisible || controlCenterState.isVisible
|
|
|
|
|
-// if (!focus && !somethingVisible) {
|
|
|
|
|
-// panelState.hide()
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ val handlePanelFocus: (Boolean) -> Unit = { focus ->
|
|
|
|
|
+ if (!focus) {
|
|
|
|
|
+ if (!menuState.isVisible) {
|
|
|
|
|
+ panelState.hide()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
val handleControlCenterFocus: (Boolean) -> Unit = { focus ->
|
|
val handleControlCenterFocus: (Boolean) -> Unit = { focus ->
|
|
|
- if (!menuState.isWindowFocus && !focus && !panelState.isWindowFocus) {
|
|
|
|
|
|
|
+ if (!focus) {
|
|
|
controlCenterState.hide()
|
|
controlCenterState.hide()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// RebuggerConfig.init(
|
|
|
|
|
-// tag = "Composition",
|
|
|
|
|
-// logger = { tag, message ->
|
|
|
|
|
-// println("$tag > $message")
|
|
|
|
|
-// }
|
|
|
|
|
-// )
|
|
|
|
|
-
|
|
|
|
|
MaterialTheme {
|
|
MaterialTheme {
|
|
|
CompositionLocalProvider(
|
|
CompositionLocalProvider(
|
|
|
LocalDesktop provides api
|
|
LocalDesktop provides api
|
|
|
) {
|
|
) {
|
|
|
MainWindow(
|
|
MainWindow(
|
|
|
- panelState = panelState,
|
|
|
|
|
- controlCenterState = controlCenterState,
|
|
|
|
|
- menuState = menuState
|
|
|
|
|
|
|
+ panelState = panelState, controlCenterState = controlCenterState, menuState = menuState
|
|
|
) {
|
|
) {
|
|
|
// ComposeWebView(
|
|
// ComposeWebView(
|
|
|
// modifier = Modifier.size(640.dp, 480.dp).align(Alignment.Center)
|
|
// modifier = Modifier.size(640.dp, 480.dp).align(Alignment.Center)
|
|
|
// )
|
|
// )
|
|
|
MemoryChart(
|
|
MemoryChart(
|
|
|
- modifier = Modifier.size(350.dp, 300.dp)
|
|
|
|
|
- .align(Alignment.BottomEnd)
|
|
|
|
|
|
|
+ modifier = Modifier.size(350.dp, 300.dp).align(Alignment.BottomEnd)
|
|
|
)
|
|
)
|
|
|
- DesktopPanel(
|
|
|
|
|
- panelState = panelState,
|
|
|
|
|
|
|
+ DesktopPanel(panelState = panelState,
|
|
|
menuState = menuState,
|
|
menuState = menuState,
|
|
|
onMenuIconClicked = { menuState.toggle() },
|
|
onMenuIconClicked = { menuState.toggle() },
|
|
|
- onFocusChange = { focus -> handlePanelFocus(focus) }
|
|
|
|
|
- )
|
|
|
|
|
- AppsMenu(
|
|
|
|
|
- menuState = menuState,
|
|
|
|
|
|
|
+ onFocusChange = { focus -> handlePanelFocus(focus) })
|
|
|
|
|
+ AppsMenu(menuState = menuState,
|
|
|
panelState = panelState,
|
|
panelState = panelState,
|
|
|
- onFocusChange = { focus -> handleMenuFocus(focus) }
|
|
|
|
|
- )
|
|
|
|
|
- ControlCenter(
|
|
|
|
|
- controlCenterState = controlCenterState,
|
|
|
|
|
- onFocusChange = { focus -> handleControlCenterFocus(focus) }
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ onFocusChange = { focus -> handleMenuFocus(focus) })
|
|
|
|
|
+ ControlCenter(controlCenterState = controlCenterState,
|
|
|
|
|
+ onFocusChange = { focus -> handleControlCenterFocus(focus) })
|
|
|
}
|
|
}
|
|
|
DisposableEffect(Unit) {
|
|
DisposableEffect(Unit) {
|
|
|
onDispose {
|
|
onDispose {
|