@@ -33,6 +33,8 @@ public MainWindow(object data)
33
33
Instance = this ;
34
34
DataContext = data ;
35
35
Title = "UnityHubNative.Net" ;
36
+ if ( UnityHubNativeNetApp . Config . extendToTitlebar )
37
+ ExtendClientAreaToDecorationsHint = true ;
36
38
Content = CreateContent ( ) ;
37
39
ReloadEverything ( ) ;
38
40
SizeToContent = SizeToContent . WidthAndHeight ;
@@ -169,59 +171,66 @@ public static void MoveSelectedProjectDown()
169
171
{
170
172
LastChildFill = true ,
171
173
HorizontalAlignment = HorizontalAlignment . Stretch ,
172
- VerticalAlignment = VerticalAlignment . Stretch
174
+ VerticalAlignment = VerticalAlignment . Stretch ,
173
175
} . AddChildren
174
176
( [
175
- new Menu
177
+ new DockPanel
176
178
{
177
- } . SetDock ( Dock . Top ) . AddItems
179
+ LastChildFill = false
180
+ } . AddChildren
178
181
( [
179
- new MenuItem
182
+ new Menu
180
183
{
181
- Header = "_File"
182
- } . AddItems
184
+ } . SetDock ( Dock . Left ) . AddItems
183
185
( [
184
186
new MenuItem
185
187
{
186
- Header = "_Create New Project" ,
187
- HotKey = new KeyGesture ( Key . N , KeyModifiers . Control ) ,
188
- InputGesture = new KeyGesture ( Key . N , KeyModifiers . Control ) ,
189
- } . OnClick ( OnCreateNewProjectClicked ) ,
190
- new MenuItem
191
- {
192
- Header = "_Add Existing Project" ,
193
- HotKey = new KeyGesture ( Key . N , KeyModifiers . Control | KeyModifiers . Shift ) ,
194
- InputGesture = new KeyGesture ( Key . N , KeyModifiers . Control | KeyModifiers . Shift )
195
- } . OnClick ( OnAddExistingProjectClicked ) ,
196
- new MenuItem
197
- {
198
- Header = "_Reload Data" ,
199
- HotKey = new KeyGesture ( Key . R , KeyModifiers . Control ) ,
200
- InputGesture = new KeyGesture ( Key . R , KeyModifiers . Control ) ,
201
- } . OnClick ( ReloadEverything ) ,
202
- ] ) ,
203
- new MenuItem
204
- {
205
- Header = "_Project" ,
206
- } . AddItems
207
- ( CreateProjectMenuItems ( ( ) => ( s_unityProjectsParent . SelectedItem as UnityProjectView ) ? . unityProject ?? null ) ) ,
208
- new MenuItem
209
- {
210
- Header = "_Window" ,
211
- } . AddItems
212
- ( [
188
+ Background = Brushes . Transparent ,
189
+ Header = "_File"
190
+ } . AddItems
191
+ ( [
192
+ new MenuItem
193
+ {
194
+ Header = "_Create New Project" ,
195
+ HotKey = new KeyGesture ( Key . N , KeyModifiers . Control ) ,
196
+ InputGesture = new KeyGesture ( Key . N , KeyModifiers . Control ) ,
197
+ } . OnClick ( OnCreateNewProjectClicked ) ,
198
+ new MenuItem
199
+ {
200
+ Header = "_Add Existing Project" ,
201
+ HotKey = new KeyGesture ( Key . N , KeyModifiers . Control | KeyModifiers . Shift ) ,
202
+ InputGesture = new KeyGesture ( Key . N , KeyModifiers . Control | KeyModifiers . Shift )
203
+ } . OnClick ( OnAddExistingProjectClicked ) ,
204
+ new MenuItem
205
+ {
206
+ Header = "_Reload Data" ,
207
+ HotKey = new KeyGesture ( Key . R , KeyModifiers . Control ) ,
208
+ InputGesture = new KeyGesture ( Key . R , KeyModifiers . Control ) ,
209
+ } . OnClick ( ReloadEverything ) ,
210
+ ] ) ,
213
211
new MenuItem
214
212
{
215
- Header = "_Close Window" ,
216
- HotKey = new ( Key . W , KeyModifiers . Control ) ,
217
- InputGesture = new ( Key . W , KeyModifiers . Control )
218
- } . OnClick ( static ( ) => Instance . Close ( ) ) ,
213
+ Header = "_Project" ,
214
+ } . AddItems
215
+ ( CreateProjectMenuItems ( ( ) => ( s_unityProjectsParent . SelectedItem as UnityProjectView ) ? . unityProject ?? null ) ) ,
219
216
new MenuItem
220
217
{
221
- Header = "_About UnityHubNative.Net" ,
222
- } . OnClick ( OnAboutClicked ) ,
218
+ Header = "_Window" ,
219
+ } . AddItems
220
+ ( [
221
+ new MenuItem
222
+ {
223
+ Header = "_Close Window" ,
224
+ HotKey = new ( Key . W , KeyModifiers . Control ) ,
225
+ InputGesture = new ( Key . W , KeyModifiers . Control )
226
+ } . OnClick ( static ( ) => Instance . Close ( ) ) ,
227
+ new MenuItem
228
+ {
229
+ Header = "_About UnityHubNative.Net" ,
230
+ } . OnClick ( OnAboutClicked ) ,
231
+ ] ) ,
223
232
] ) ,
224
- ] ) ,
233
+ ] ) . SetDock ( Dock . Top ) ,
225
234
new DockPanel
226
235
{
227
236
} . AddChildren
@@ -378,17 +387,33 @@ public static void MoveSelectedProjectDown()
378
387
( [
379
388
new TextBlock
380
389
{
381
- Text = "Transparent Window" ,
382
- VerticalAlignment = VerticalAlignment . Center ,
383
- } . SetDock ( Dock . Left ) ,
384
- new CheckBox
385
- {
386
- IsChecked = UnityHubNativeNetApp . Config . transparent ,
390
+ Text = "Appearance" ,
387
391
VerticalAlignment = VerticalAlignment . Center ,
388
- } . OnCheckChanged ( OnTransparencyCheckboxChanged ) . SetDock ( Dock . Right ) ,
389
- ] ) . SetTooltip ( "Makes the window transparent. Uses Mica on Windows and the desktop's blur on Linux.\n Needs restart to take effect." ) ,
390
- } . SetDock ( Dock . Top ) . AddItems
392
+ } . SetTooltip ( "Control the appearence of the app. Can affect performance." ) . SetDock ( Dock . Left )
393
+ ] ) ,
394
+ } . SetTooltip ( "" )
395
+ . SetDock ( Dock . Top )
396
+ . AddItems
391
397
( [
398
+ new SettingsExpanderItem
399
+ {
400
+ Content = new DockPanel
401
+ {
402
+ LastChildFill = false
403
+ } . AddChildren
404
+ ( [
405
+ new TextBlock
406
+ {
407
+ Text = "Transparent Window" ,
408
+ VerticalAlignment = VerticalAlignment . Center ,
409
+ } . SetDock ( Dock . Left ) ,
410
+ new CheckBox
411
+ {
412
+ IsChecked = UnityHubNativeNetApp . Config . transparent ,
413
+ VerticalAlignment = VerticalAlignment . Center ,
414
+ } . OnCheckChanged ( OnTransparencyCheckboxChanged ) . SetDock ( Dock . Right ) ,
415
+ ] ) . SetTooltip ( "Makes the window transparent. Uses Mica on Windows and the desktop's blur on Linux.\n Needs restart to take effect." ) ,
416
+ } ,
392
417
new SettingsExpanderItem
393
418
{
394
419
Content = s_transparentPanel = new DockPanel
@@ -440,6 +465,24 @@ public static void MoveSelectedProjectDown()
440
465
Value = UnityHubNativeNetApp . Config . blurIntensity
441
466
} . OnValueChanged ( OnAcrylicIntensitySliderValueChanged ) . SetDock ( Dock . Right )
442
467
] ) . SetDock ( Dock . Top )
468
+ } ,
469
+ new SettingsExpanderItem
470
+ {
471
+ Content = new DockPanel
472
+ {
473
+ LastChildFill = false ,
474
+ } . AddChildren
475
+ ( [
476
+ new TextBlock
477
+ {
478
+ Text = "Extend to Titlebar" ,
479
+ VerticalAlignment = VerticalAlignment . Center ,
480
+ } . SetTooltip ( "Extends the client area to the titlebar." ) . SetDock ( Dock . Left ) ,
481
+ new CheckBox
482
+ {
483
+ IsChecked = UnityHubNativeNetApp . Config . extendToTitlebar
484
+ } . OnCheckChanged ( OnExtendToTitlebarCheckChanged ) . SetDock ( Dock . Right )
485
+ ] ) . SetDock ( Dock . Top )
443
486
}
444
487
] ) ,
445
488
new SettingsExpander
@@ -483,6 +526,13 @@ public static void MoveSelectedProjectDown()
483
526
] )
484
527
] ) ;
485
528
529
+ static void OnExtendToTitlebarCheckChanged ( )
530
+ {
531
+ UnityHubNativeNetApp . Config . extendToTitlebar = ! UnityHubNativeNetApp . Config . extendToTitlebar ;
532
+ Instance . ExtendClientAreaToDecorationsHint = UnityHubNativeNetApp . Config . extendToTitlebar ;
533
+ UnityHubNativeNetApp . SaveConfig ( UnityHubNativeNetApp . Config ) ;
534
+ }
535
+
486
536
public static MenuItem [ ] CreateProjectMenuItems ( Func < UnityProject > unityProjectGetter )
487
537
{
488
538
return
0 commit comments