mirror of
https://github.com/dscyrescotti/Memola.git
synced 2026-03-20 00:24:12 +01:00
feat: update for macos
This commit is contained in:
@@ -58,6 +58,7 @@ struct Sidebar: View {
|
||||
.navigationSplitViewColumnWidth(min: 250, ideal: 250, max: 250)
|
||||
}
|
||||
|
||||
#if os(iOS)
|
||||
private var compactList: some View {
|
||||
list
|
||||
.toolbar {
|
||||
@@ -66,6 +67,7 @@ struct Sidebar: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
private var list: some View {
|
||||
List(selection: $sidebarItem) {
|
||||
|
||||
@@ -16,14 +16,22 @@ struct AboutView: View {
|
||||
Spacer()
|
||||
Text("v\(Bundle.main.appVersion) (\(Bundle.main.appBuild))")
|
||||
}
|
||||
#if os(macOS)
|
||||
.listRowSeparator(.hidden)
|
||||
#endif
|
||||
}
|
||||
Section("Copyright") {
|
||||
Section("COPYRIGHT") {
|
||||
Text(Bundle.main.copyright)
|
||||
.font(.callout)
|
||||
#if os(macOS)
|
||||
.listRowSeparator(.hidden)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
.listStyle(.insetGrouped)
|
||||
.navigationTitle("About")
|
||||
#if os(iOS)
|
||||
.listStyle(.insetGrouped)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
import SwiftUI
|
||||
|
||||
struct SettingsView: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
List {
|
||||
@@ -19,10 +21,33 @@ struct SettingsView: View {
|
||||
}
|
||||
}
|
||||
.navigationTitle("Settings")
|
||||
#if os(iOS)
|
||||
.navigationBarTitleDisplayMode(.large)
|
||||
#endif
|
||||
.toolbar {
|
||||
#if os(iOS)
|
||||
ToolbarItem(placement: .topBarTrailing) {
|
||||
Button {
|
||||
dismiss()
|
||||
} label: {
|
||||
Text("Close")
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
.focusedSceneValue(\.activeSceneKey, .settings)
|
||||
.interactiveDismissDisabled()
|
||||
#if os(macOS)
|
||||
.onAppear {
|
||||
DispatchQueue.main.async {
|
||||
NSApplication.shared.windows.forEach { window in
|
||||
guard window.identifier?.rawValue.contains(AppWindow.settings.id) == true else { return }
|
||||
window.standardWindowButton(.zoomButton)?.isEnabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user