mirror of
https://github.com/neon443/DockPhobia.git
synced 2026-03-11 23:06:17 +00:00
add menu bar
This commit is contained in:
@@ -10,10 +10,16 @@ import SwiftUI
|
||||
struct ContentView: View {
|
||||
var body: some View {
|
||||
VStack {
|
||||
|
||||
Image(systemName: "globe")
|
||||
.imageScale(.large)
|
||||
.foregroundStyle(.tint)
|
||||
Text("Hello, world!")
|
||||
Button() {
|
||||
NSApp.terminate(nil)
|
||||
} label: {
|
||||
Text("Quit")
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
|
||||
@@ -9,9 +9,30 @@ import SwiftUI
|
||||
|
||||
@main
|
||||
struct DockPhobiaApp: App {
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ContentView()
|
||||
}
|
||||
}
|
||||
var body: some Scene {
|
||||
MenuBarExtra(
|
||||
"Menu Bar",
|
||||
systemImage: "star"
|
||||
) {
|
||||
ContentView()
|
||||
.overlay(alignment: .topLeading) {
|
||||
Button() {
|
||||
NSApp.terminate(nil)
|
||||
} label: {
|
||||
Image(systemName: "xmark.circle.fill")
|
||||
.foregroundStyle(.blue)
|
||||
}
|
||||
.buttonStyle(PlainButtonStyle())
|
||||
}
|
||||
.frame(width: 300, height: 180)
|
||||
}
|
||||
.menuBarExtraStyle(.window)
|
||||
}
|
||||
}
|
||||
//struct DockPhobiaApp: App {
|
||||
// var body: some Scene {
|
||||
// WindowGroup {
|
||||
// ContentView()
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user