Refactor and Rename to CommandNotch
This commit is contained in:
36
Downterm/CommandNotch/CommandNotchApp.swift
Normal file
36
Downterm/CommandNotch/CommandNotchApp.swift
Normal file
@@ -0,0 +1,36 @@
|
||||
import SwiftUI
|
||||
|
||||
/// Main entry point for the CommandNotch application.
|
||||
/// Provides a MenuBarExtra for quick access to settings and app controls.
|
||||
/// The notch windows and terminal sessions are managed by AppDelegate + ScreenManager.
|
||||
@main
|
||||
struct CommandNotchApp: App {
|
||||
|
||||
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
|
||||
|
||||
@AppStorage(NotchSettings.Keys.showMenuBarIcon)
|
||||
private var showMenuBarIcon = NotchSettings.Defaults.showMenuBarIcon
|
||||
|
||||
var body: some Scene {
|
||||
MenuBarExtra("CommandNotch", systemImage: "terminal", isInserted: $showMenuBarIcon) {
|
||||
Button("Toggle Notch") {
|
||||
ScreenManager.shared.toggleNotchOnActiveScreen()
|
||||
}
|
||||
.keyboardShortcut(.return, modifiers: .command)
|
||||
|
||||
Divider()
|
||||
|
||||
Button("Settings...") {
|
||||
SettingsWindowController.shared.showSettings()
|
||||
}
|
||||
.keyboardShortcut(",", modifiers: .command)
|
||||
|
||||
Divider()
|
||||
|
||||
Button("Quit CommandNotch") {
|
||||
NSApplication.shared.terminate(nil)
|
||||
}
|
||||
.keyboardShortcut("Q", modifiers: .command)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user