Skip to content

Commit

Permalink
Use dynamic sidebar width
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbaird committed Oct 5, 2024
1 parent 830e089 commit 3f08f0b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Ice/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ import SwiftUI

struct SettingsView: View {
@EnvironmentObject var navigationState: AppNavigationState
@Environment(\.sidebarRowSize) var sidebarRowSize

private var sidebarWidth: CGFloat {
switch sidebarRowSize {
case .small: 206
case .medium: 210
case .large: 214
@unknown default: 210
}
}

var body: some View {
NavigationSplitView {
Expand Down Expand Up @@ -40,7 +50,7 @@ struct SettingsView: View {
}
.scrollDisabled(true)
.removeSidebarToggle()
.navigationSplitViewColumnWidth(210)
.navigationSplitViewColumnWidth(sidebarWidth)
}

@ViewBuilder
Expand Down

0 comments on commit 3f08f0b

Please sign in to comment.