Skip to content

Commit 8be47fc

Browse files
patch (settings): move to Settings instead of Window
1 parent 2919e21 commit 8be47fc

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

Swiftcord/SwiftcordApp.swift

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,22 +100,19 @@ struct SwiftcordApp: App {
100100
}
101101
}
102102
.commands {
103+
#if !APP_STORE
103104
CommandGroup(after: .appInfo) {
104-
#if !APP_STORE
105105
CheckForUpdatesView(updaterViewModel: updaterViewModel)
106-
#endif
107-
if #available(macOS 13, *) {
108-
SettingsCommands()
109-
}
110106
}
107+
#endif
111108

112109
SidebarCommands()
113110
NavigationCommands(state: state, gateway: gateway)
114111
}
115112
.windowStyle(.hiddenTitleBar)
116113
.windowToolbarStyle(.unified)
117114

118-
WindowGroup(id: "settings") { // Identify the window group.
115+
Settings {
119116
SettingsView()
120117
.environmentObject(gateway)
121118
.environmentObject(state)
@@ -125,7 +122,18 @@ struct SwiftcordApp: App {
125122
? .dark
126123
: (selectedTheme == "light" ? .light : .none)
127124
)
128-
}.contentSizedWindowResizability()
125+
.task {
126+
// print("run")
127+
let window = NSApp.windows.first { $0.identifier?.rawValue == "com_apple_SwiftUI_Settings_window" }!
128+
window.toolbarStyle = .unified
129+
130+
let sidebaritem = "com.apple.SwiftUI.navigationSplitView.toggleSidebar"
131+
let index = window.toolbar?.items.firstIndex { $0.itemIdentifier.rawValue == sidebaritem }
132+
if let index {
133+
window.toolbar?.removeItem(at: index)
134+
}
135+
}
136+
}
129137
}
130138
}
131139

0 commit comments

Comments
 (0)