@@ -42,6 +42,28 @@ public MainWindow()
42
42
Locator . CurrentMutable . RegisterLazySingleton ( ( ) => ViewModel , typeof ( MainWindowViewModel ) ) ;
43
43
44
44
WindowsHandler . Instance . RegisterGlobalHotkey ( _config , OnHotkeyHandler , null ) ;
45
+ if ( _config . uiItem . mainGirdOrientation == EGirdOrientation . Horizontal )
46
+ {
47
+ tabProfiles . Content ??= new ProfilesView ( ) ;
48
+ tabMsgView . Content ??= new MsgView ( ) ;
49
+ tabClashProxies . Content ??= new ClashProxiesView ( ) ;
50
+ tabClashConnections . Content ??= new ClashConnectionsView ( ) ;
51
+ }
52
+ else if ( _config . uiItem . mainGirdOrientation == EGirdOrientation . Vertical )
53
+ {
54
+ tabProfiles1 . Content ??= new ProfilesView ( ) ;
55
+ tabMsgView1 . Content ??= new MsgView ( ) ;
56
+ tabClashProxies1 . Content ??= new ClashProxiesView ( ) ;
57
+ tabClashConnections1 . Content ??= new ClashConnectionsView ( ) ;
58
+ }
59
+ else
60
+ {
61
+ tabProfiles2 . Content ??= new ProfilesView ( ) ;
62
+ tabMsgView2 . Content ??= new MsgView ( ) ;
63
+ tabClashProxies2 . Content ??= new ClashProxiesView ( ) ;
64
+ tabClashConnections2 . Content ??= new ClashConnectionsView ( ) ;
65
+ }
66
+ pbTheme . Content ??= new ThemeSettingView ( ) ;
45
67
46
68
this . WhenActivated ( disposables =>
47
69
{
@@ -150,30 +172,7 @@ public MainWindow()
150
172
{
151
173
RenderOptions . ProcessRenderMode = RenderMode . SoftwareOnly ;
152
174
}
153
-
154
- if ( _config . uiItem . mainGirdOrientation == EGirdOrientation . Horizontal )
155
- {
156
- tabProfiles . Content ??= new ProfilesView ( ) ;
157
- tabMsgView . Content ??= new MsgView ( ) ;
158
- tabClashProxies . Content ??= new ClashProxiesView ( ) ;
159
- tabClashConnections . Content ??= new ClashConnectionsView ( ) ;
160
- }
161
- else if ( _config . uiItem . mainGirdOrientation == EGirdOrientation . Vertical )
162
- {
163
- tabProfiles1 . Content ??= new ProfilesView ( ) ;
164
- tabMsgView1 . Content ??= new MsgView ( ) ;
165
- tabClashProxies1 . Content ??= new ClashProxiesView ( ) ;
166
- tabClashConnections1 . Content ??= new ClashConnectionsView ( ) ;
167
- }
168
- else
169
- {
170
- tabProfiles2 . Content ??= new ProfilesView ( ) ;
171
- tabMsgView2 . Content ??= new MsgView ( ) ;
172
- tabClashProxies2 . Content ??= new ClashProxiesView ( ) ;
173
- tabClashConnections2 . Content ??= new ClashConnectionsView ( ) ;
174
- }
175
- pbTheme . Content ??= new ThemeSettingView ( ) ;
176
-
175
+
177
176
RestoreUI ( ) ;
178
177
AddHelpMenuItem ( ) ;
179
178
}
0 commit comments