mirror of
https://github.com/yattee/yattee.git
synced 2025-10-14 19:38:13 +00:00
Add Welcome screen
This commit is contained in:
27
Shared/Views/OpenSettingsButton.swift
Normal file
27
Shared/Views/OpenSettingsButton.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
import SwiftUI
|
||||
|
||||
struct OpenSettingsButton: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@EnvironmentObject<NavigationModel> private var navigation
|
||||
|
||||
var body: some View {
|
||||
Button {
|
||||
dismiss()
|
||||
|
||||
#if os(macOS)
|
||||
NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil)
|
||||
#else
|
||||
navigation.presentingSettings = true
|
||||
#endif
|
||||
} label: {
|
||||
Label("Open Settings", systemImage: "gearshape.2")
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
}
|
||||
}
|
||||
|
||||
struct OpenSettingsButton_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
OpenSettingsButton()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user