@@ -10,6 +10,21 @@ import SwiftUI
1010/// Settings tab identifiers for programmatic navigation
1111enum SettingsTab : String {
1212 case general, appearance, editor, dataGrid, keyboard, history, ai, plugins, sync, license
13+
14+ var preferredSize : CGSize {
15+ switch self {
16+ case . general: CGSize ( width: 450 , height: 380 )
17+ case . appearance: CGSize ( width: 720 , height: 500 )
18+ case . editor: CGSize ( width: 450 , height: 300 )
19+ case . dataGrid: CGSize ( width: 450 , height: 380 )
20+ case . keyboard: CGSize ( width: 500 , height: 500 )
21+ case . history: CGSize ( width: 450 , height: 320 )
22+ case . ai: CGSize ( width: 500 , height: 520 )
23+ case . plugins: CGSize ( width: 650 , height: 500 )
24+ case . sync: CGSize ( width: 450 , height: 420 )
25+ case . license: CGSize ( width: 450 , height: 280 )
26+ }
27+ }
1328}
1429
1530/// Main settings view with tab-based navigation (macOS Settings style)
@@ -18,6 +33,10 @@ struct SettingsView: View {
1833 @Environment ( UpdaterBridge . self) var updaterBridge
1934 @AppStorage ( " selectedSettingsTab " ) private var selectedTab : String = SettingsTab . general. rawValue
2035
36+ private var currentTab : SettingsTab {
37+ SettingsTab ( rawValue: selectedTab) ?? . general
38+ }
39+
2140 var body : some View {
2241 TabView ( selection: $selectedTab) {
2342 GeneralSettingsView ( settings: $settingsManager. general, updaterBridge: updaterBridge)
@@ -81,7 +100,8 @@ struct SettingsView: View {
81100 }
82101 . tag ( SettingsTab . license. rawValue)
83102 }
84- . frame ( width: 720 , height: 500 )
103+ . frame ( width: currentTab. preferredSize. width, height: currentTab. preferredSize. height)
104+ . background ( SettingsWindowResizer ( size: currentTab. preferredSize) )
85105 }
86106}
87107
0 commit comments