mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 18:35:05 +00:00
Restore Settings as sidebar item on macOS
Remove the gear toolbar button that opened Settings as a sheet in the NavigationSplitView sidebar column, and drop the macOS guard hiding .settings from SidebarMainItem so it can be added to the sidebar and rendered in the detail column like other items. The dedicated Settings window (Cmd+,) is unchanged.
This commit is contained in:
@@ -124,12 +124,6 @@ enum SidebarMainItem: String, CaseIterable, Codable, Identifiable, Sendable {
|
|||||||
#else
|
#else
|
||||||
return true
|
return true
|
||||||
#endif
|
#endif
|
||||||
case .settings:
|
|
||||||
#if os(macOS)
|
|
||||||
return false
|
|
||||||
#else
|
|
||||||
return true
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -376,11 +376,6 @@ struct UnifiedTabView: View {
|
|||||||
// Zoom transition namespace (local to this tab view)
|
// Zoom transition namespace (local to this tab view)
|
||||||
@Namespace private var zoomTransition
|
@Namespace private var zoomTransition
|
||||||
|
|
||||||
// Settings sheet (rendered from the NavigationSplitView toolbar so the gear sits
|
|
||||||
// immediately after the system-vended sidebar-toggle in the sidebar column).
|
|
||||||
@State private var showingSettings = false
|
|
||||||
@Namespace private var sheetTransition
|
|
||||||
|
|
||||||
private var yatteeServerAuthHeader: String? {
|
private var yatteeServerAuthHeader: String? {
|
||||||
guard let server = appEnvironment?.instancesManager.enabledYatteeServerInstances.first else { return nil }
|
guard let server = appEnvironment?.instancesManager.enabledYatteeServerInstances.first else { return nil }
|
||||||
return appEnvironment?.basicAuthCredentialsManager.basicAuthHeader(for: server)
|
return appEnvironment?.basicAuthCredentialsManager.basicAuthHeader(for: server)
|
||||||
@@ -389,28 +384,9 @@ struct UnifiedTabView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationSplitView {
|
NavigationSplitView {
|
||||||
sidebar
|
sidebar
|
||||||
.toolbar {
|
|
||||||
ToolbarItem(placement: .primaryAction) {
|
|
||||||
Button {
|
|
||||||
showingSettings = true
|
|
||||||
} label: {
|
|
||||||
Image(systemName: "gear")
|
|
||||||
}
|
|
||||||
.accessibilityIdentifier("app.settingsButton")
|
|
||||||
.accessibilityLabel(String(localized: "settings.title"))
|
|
||||||
.liquidGlassTransitionSource(id: "appSettings", in: sheetTransition)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} detail: {
|
} detail: {
|
||||||
detailForSelection
|
detailForSelection
|
||||||
}
|
}
|
||||||
.sheet(isPresented: $showingSettings) {
|
|
||||||
SettingsView()
|
|
||||||
.liquidGlassSheetContent(sourceID: "appSettings", in: sheetTransition)
|
|
||||||
}
|
|
||||||
.onChange(of: appEnvironment?.navigationCoordinator.dismissSettingsTrigger) {
|
|
||||||
showingSettings = false
|
|
||||||
}
|
|
||||||
.zoomTransitionNamespace(zoomTransition)
|
.zoomTransitionNamespace(zoomTransition)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
configureSidebarManager()
|
configureSidebarManager()
|
||||||
|
|||||||
Reference in New Issue
Block a user