Quellcode durchsuchen

Add Hide App action to launcher overflow menu.

Provide a direct hide command in the ellipsis menu and place it in a separated bottom section so users can quickly dismiss the launcher without using the status bar.

Made-with: Cursor
huzaifahayat12 vor 3 Monaten
Ursprung
Commit
b905d97b0d
1 geänderte Dateien mit 10 neuen und 0 gelöschten Zeilen
  1. 10 0
      google_apps/LauncherRootView.swift

+ 10 - 0
google_apps/LauncherRootView.swift

@@ -131,6 +131,11 @@ struct LauncherRootView: View {
                             InAppBrowserWindowManager.shared.open(url: url, title: "Google")
                         }
                     },
+                    onHideApp: {
+                        if let window = NSApp.keyWindow ?? NSApp.mainWindow ?? NSApp.windows.first {
+                            window.orderOut(nil)
+                        }
+                    },
                     onOpenHomePage: { openExternalPage(ExternalPage.home) },
                     onOpenSupportPage: { openExternalPage(ExternalPage.support) },
                     onOpenPrivacyPolicy: { openExternalPage(ExternalPage.privacy) },
@@ -561,6 +566,7 @@ private struct SearchHeader: View {
     let onToggleLayout: () -> Void
     let onOpenPremium: () -> Void
     let onOpenGoogle: () -> Void
+    let onHideApp: () -> Void
     let onOpenHomePage: () -> Void
     let onOpenSupportPage: () -> Void
     let onOpenPrivacyPolicy: () -> Void
@@ -683,6 +689,10 @@ private struct SearchHeader: View {
                             }
                         }
                     }
+                    Divider()
+                    Button("Hide App") {
+                        onHideApp()
+                    }
                 } label: {
                     Image(systemName: "ellipsis")
                 }