Quellcode durchsuchen

design improvements

design improvements
Milan Jurkulak vor 2 Jahren
Ursprung
Commit
3ad6895bd0

+ 7 - 6
src/main/kotlin/eu/mjdev/desktop/components/desktoppanel/DesktopPanel.kt

@@ -40,9 +40,10 @@ import eu.mjdev.desktop.windows.ChromeWindow
 fun DesktopPanel(
     api: DesktopProvider = LocalDesktop.current,
     backgroundColor: Color = api.currentUser.theme.backgroundColor,
-    shadowColor: Color = Color.Black.copy(alpha = 0.3f),
+//    shadowColor: Color = Color.Black.copy(alpha = 0.3f),
     iconColor: Color = Color.Black,
-    iconBackgroundColor: Color = Color.White,
+    iconColorRunning: Color = Color.White.copy(0.8f),
+    iconBackgroundColor: Color = Color.White.copy(0.6f),
     dividerWidth: Dp = 4.dp,
     iconSize: DpSize = DpSize(56.dp, 56.dp),
     iconPadding: PaddingValues = PaddingValues(4.dp),
@@ -118,7 +119,6 @@ fun DesktopPanel(
                         modifier = Modifier
                             .fillMaxWidth()
                             .height(tooltipHeight)
-
                     )
                     Column(
                         modifier = Modifier
@@ -129,12 +129,12 @@ fun DesktopPanel(
                                     colors = listOf(
                                         backgroundColor.copy(alpha = 0.3f),
                                         backgroundColor.copy(alpha = 0.7f),
-                                        backgroundColor.copy(alpha = 0.3f),
+                                        backgroundColor.copy(alpha = 0.8f),
                                     )
                                 )
                             )
                             .topShadow(
-                                color = shadowColor,
+                                color = backgroundColor.copy(alpha = 0.3f),
                                 offsetY = 4.dp,
                                 blur = 10.dp
                             )
@@ -149,7 +149,7 @@ fun DesktopPanel(
                         )
                         Box(
                             modifier = Modifier.fillMaxWidth()
-                                .wrapContentHeight()
+                                .padding(top = 4.dp)
                                 .padding(panelContentPadding)
                         ) {
                             if (showMenuIcon) {
@@ -168,6 +168,7 @@ fun DesktopPanel(
                                 modifier = Modifier.align(Alignment.Center),
                                 iconColor = iconColor,
                                 iconBackgroundColor = iconBackgroundColor,
+                                iconColorRunning = iconColorRunning,
                                 iconSize = iconSize,
                                 iconPadding = iconPadding,
                                 iconOuterPadding = iconOuterPadding,

+ 5 - 4
src/main/kotlin/eu/mjdev/desktop/components/desktoppanel/DesktopPanelIcon.kt

@@ -42,7 +42,8 @@ fun DesktopPanelIcon(
     icon: String? = null,
     iconColor: Color = Color.Black,
     iconBackgroundColor: Color = Color.White,
-    iconBackgroundHover: Color = Color.Red,
+    iconBackgroundHover: Color = Color.White,
+    iconColorRunning: Color = Color.White,
     iconSize: DpSize = DpSize(48.dp, 48.dp),
     iconPadding: PaddingValues = PaddingValues(4.dp),
     iconOuterPadding: PaddingValues = PaddingValues(2.dp),
@@ -54,7 +55,7 @@ fun DesktopPanelIcon(
     val iconName = remember(app, icon) { app?.name ?: icon }
     val materialIcon = remember(iconName) { api.currentUser.theme.iconSet.iconForName(iconName) ?: "?".toInt() }
     val background = when {
-        (iconState.value || isRunning) -> iconBackgroundHover
+        iconState.value -> iconBackgroundHover
         else -> Color.Transparent
     }
     Box(
@@ -82,7 +83,7 @@ fun DesktopPanelIcon(
             FontIcon(
                 iconId = materialIcon,
                 iconColor = iconColor,
-                iconBackgroundColor = iconBackgroundColor,
+                iconBackgroundColor = if (isRunning) iconColorRunning else iconBackgroundColor,
                 iconSize = iconSize,
                 innerPadding = iconPadding,
                 outerPadding = iconOuterPadding,
@@ -96,7 +97,7 @@ fun DesktopPanelIcon(
             CircularProgressIndicator(
                 modifier = Modifier.size(iconSize),
                 color = Color.White,
-                strokeWidth = 10.dp,
+                strokeWidth = 4.dp,
                 backgroundColor = Color.Transparent
             )
         }

+ 2 - 0
src/main/kotlin/eu/mjdev/desktop/components/desktoppanel/applets/DesktopPanelFavoriteApps.kt

@@ -25,6 +25,7 @@ fun DesktopPanelFavoriteApps(
     api: DesktopProvider = LocalDesktop.current,
     iconColor: Color = Color.Black,
     iconBackgroundColor: Color = Color.White,
+    iconColorRunning: Color = Color.White,
     iconSize: DpSize = DpSize(56.dp, 56.dp),
     iconPadding: PaddingValues = PaddingValues(4.dp),
     iconOuterPadding: PaddingValues = PaddingValues(2.dp),
@@ -46,6 +47,7 @@ fun DesktopPanelFavoriteApps(
                 isStarting = app.isStarted,
                 iconColor = iconColor,
                 iconBackgroundColor = iconBackgroundColor,
+                iconColorRunning = iconColorRunning,
                 iconBackgroundHover = Color.White.copy(alpha = 0.4f),
                 iconSize = iconSize,
                 iconPadding = iconPadding,