Bladeren bron

Refine panel row hover: full-width highlight and logo padding

- Use background on framed row so hover fills scroll width; IconPanelView rows use maxWidth infinity
- Add vertical padding around row content and raise minHeight for space above/below icons
- Drop GeometryReader hover inset; center ellipsis menu with maxHeight frame
- contentShape for full-row hover hit testing

Made-with: Cursor
huzaifahayat12 3 maanden geleden
bovenliggende
commit
e8aa7ac5a6
1 gewijzigde bestanden met toevoegingen van 28 en 25 verwijderingen
  1. 28 25
      google_apps/LauncherRootView.swift

+ 28 - 25
google_apps/LauncherRootView.swift

@@ -611,9 +611,10 @@ private struct IconPanelView: View {
                         onMove: onMove,
                         onHideApp: onHideApp
                     )
+                    .frame(maxWidth: .infinity, alignment: .leading)
                 }
             }
-            .padding(.horizontal, 10)
+            .frame(maxWidth: .infinity, alignment: .leading)
             .padding(.bottom, 18)
         }
     }
@@ -671,28 +672,7 @@ private struct PanelAppRowView: View {
     }
 
     var body: some View {
-        ZStack {
-            RoundedRectangle(cornerRadius: 12, style: .continuous)
-                .fill(Color.white.opacity(isHovering ? 0.18 : 0))
-                .overlay(
-                    RoundedRectangle(cornerRadius: 12, style: .continuous)
-                        .stroke(
-                            LinearGradient(
-                                colors: [
-                                    Color.white.opacity(isHovering ? 0.38 : 0),
-                                    Color.white.opacity(isHovering ? 0.14 : 0),
-                                ],
-                                startPoint: .topLeading,
-                                endPoint: .bottomTrailing
-                            ),
-                            lineWidth: 1
-                        )
-                )
-                .shadow(color: Color.black.opacity(isHovering ? 0.35 : 0), radius: isHovering ? 14 : 0, x: 0, y: 4)
-                .animation(.easeOut(duration: 0.14), value: isHovering)
-                .allowsHitTesting(false)
-
-            ZStack(alignment: .trailing) {
+        ZStack(alignment: .trailing) {
             HStack(spacing: 14) {
                 AppIconGlyph(app: app)
                     .scaleEffect(isHovering ? 1.05 : 1.0, anchor: .leading)
@@ -776,10 +756,33 @@ private struct PanelAppRowView: View {
                 .padding(8)
                 .opacity(isHovering ? 1 : 0.0)
                 .animation(.easeOut(duration: 0.12), value: isHovering)
+                .frame(maxHeight: .infinity, alignment: .center)
             }
-            }
         }
-        .frame(maxWidth: .infinity, alignment: .leading)
+        .padding(.vertical, 4)
+        .padding(.horizontal, 10)
+        .frame(maxWidth: .infinity, minHeight: 60, alignment: .leading)
+        .background {
+            RoundedRectangle(cornerRadius: 12, style: .continuous)
+                .fill(Color.white.opacity(isHovering ? 0.18 : 0))
+                .overlay(
+                    RoundedRectangle(cornerRadius: 12, style: .continuous)
+                        .stroke(
+                            LinearGradient(
+                                colors: [
+                                    Color.white.opacity(isHovering ? 0.38 : 0),
+                                    Color.white.opacity(isHovering ? 0.14 : 0),
+                                ],
+                                startPoint: .topLeading,
+                                endPoint: .bottomTrailing
+                            ),
+                            lineWidth: 1
+                        )
+                )
+                .shadow(color: Color.black.opacity(isHovering ? 0.35 : 0), radius: isHovering ? 14 : 0, x: 0, y: 4)
+                .animation(.easeOut(duration: 0.14), value: isHovering)
+        }
+        .contentShape(Rectangle())
         .onHover { hovering in
             isHovering = hovering
         }