mirror of
https://github.com/dscyrescotti/Memola.git
synced 2026-07-06 21:05:20 +02:00
feat: update for macos
This commit is contained in:
@@ -58,6 +58,7 @@ struct Sidebar: View {
|
|||||||
.navigationSplitViewColumnWidth(min: 250, ideal: 250, max: 250)
|
.navigationSplitViewColumnWidth(min: 250, ideal: 250, max: 250)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if os(iOS)
|
||||||
private var compactList: some View {
|
private var compactList: some View {
|
||||||
list
|
list
|
||||||
.toolbar {
|
.toolbar {
|
||||||
@@ -66,6 +67,7 @@ struct Sidebar: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private var list: some View {
|
private var list: some View {
|
||||||
List(selection: $sidebarItem) {
|
List(selection: $sidebarItem) {
|
||||||
|
|||||||
@@ -16,14 +16,22 @@ struct AboutView: View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
Text("v\(Bundle.main.appVersion) (\(Bundle.main.appBuild))")
|
Text("v\(Bundle.main.appVersion) (\(Bundle.main.appBuild))")
|
||||||
}
|
}
|
||||||
|
#if os(macOS)
|
||||||
|
.listRowSeparator(.hidden)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
Section("Copyright") {
|
Section("COPYRIGHT") {
|
||||||
Text(Bundle.main.copyright)
|
Text(Bundle.main.copyright)
|
||||||
.font(.callout)
|
.font(.callout)
|
||||||
|
#if os(macOS)
|
||||||
|
.listRowSeparator(.hidden)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listStyle(.insetGrouped)
|
|
||||||
.navigationTitle("About")
|
.navigationTitle("About")
|
||||||
|
#if os(iOS)
|
||||||
|
.listStyle(.insetGrouped)
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct SettingsView: View {
|
struct SettingsView: View {
|
||||||
|
@Environment(\.dismiss) private var dismiss
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationStack {
|
NavigationStack {
|
||||||
List {
|
List {
|
||||||
@@ -19,10 +21,33 @@ struct SettingsView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationTitle("Settings")
|
.navigationTitle("Settings")
|
||||||
|
#if os(iOS)
|
||||||
.navigationBarTitleDisplayMode(.large)
|
.navigationBarTitleDisplayMode(.large)
|
||||||
|
#endif
|
||||||
|
.toolbar {
|
||||||
|
#if os(iOS)
|
||||||
|
ToolbarItem(placement: .topBarTrailing) {
|
||||||
|
Button {
|
||||||
|
dismiss()
|
||||||
|
} label: {
|
||||||
|
Text("Close")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.focusedSceneValue(\.activeSceneKey, .settings)
|
.focusedSceneValue(\.activeSceneKey, .settings)
|
||||||
.interactiveDismissDisabled()
|
.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