milan jurkulák před 2 roky
rodič
revize
b4a26397c1

+ 16 - 39
src/main/kotlin/eu/mjdev/desktop/Main.kt

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

+ 1 - 1
src/main/kotlin/eu/mjdev/desktop/components/controlcenter/pages/MainSettingsPage.kt

@@ -96,7 +96,7 @@ fun MainSettingsPage() = ControlCenterPage(
                     backgroundColor = backgroundColor,
                     shadowColor=borderColor.alpha(0.3f),
                     iconTintColor = iconsTintColor,
-                    textColor = textColor,
+//                    textColor = textColor,
                     onPowerButtonClick = {
                         // todo : dialog
                         api.shutdown()

+ 1 - 1
src/main/kotlin/eu/mjdev/desktop/components/custom/PowerBlock.kt

@@ -28,7 +28,7 @@ import eu.mjdev.desktop.extensions.Modifier.rectShadow
 fun PowerBlock(
     backgroundColor: Color,
     shadowColor: Color = Color.Black.copy(alpha = 0.3f),
-    textColor: Color = Color.Black,
+//    textColor: Color = Color.Black,
     iconTintColor: Color = Color.White,
     bottomBoxHeight: Dp = 128.dp,
     iconHeight: Dp = 64.dp,