@@ -33,6 +33,8 @@ public MainWindow(object data)
3333 Instance = this ;
3434 DataContext = data ;
3535 Title = "UnityHubNative.Net" ;
36+ if ( UnityHubNativeNetApp . Config . extendToTitlebar )
37+ ExtendClientAreaToDecorationsHint = true ;
3638 Content = CreateContent ( ) ;
3739 ReloadEverything ( ) ;
3840 SizeToContent = SizeToContent . WidthAndHeight ;
@@ -169,59 +171,66 @@ public static void MoveSelectedProjectDown()
169171 {
170172 LastChildFill = true ,
171173 HorizontalAlignment = HorizontalAlignment . Stretch ,
172- VerticalAlignment = VerticalAlignment . Stretch
174+ VerticalAlignment = VerticalAlignment . Stretch ,
173175 } . AddChildren
174176 ( [
175- new Menu
177+ new DockPanel
176178 {
177- } . SetDock ( Dock . Top ) . AddItems
179+ LastChildFill = false
180+ } . AddChildren
178181 ( [
179- new MenuItem
182+ new Menu
180183 {
181- Header = "_File"
182- } . AddItems
184+ } . SetDock ( Dock . Left ) . AddItems
183185 ( [
184186 new MenuItem
185187 {
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+ ] ) ,
213211 new MenuItem
214212 {
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 ) ) ,
219216 new MenuItem
220217 {
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+ ] ) ,
223232 ] ) ,
224- ] ) ,
233+ ] ) . SetDock ( Dock . Top ) ,
225234 new DockPanel
226235 {
227236 } . AddChildren
@@ -378,17 +387,33 @@ public static void MoveSelectedProjectDown()
378387 ( [
379388 new TextBlock
380389 {
381- Text = "Transparent Window" ,
382- VerticalAlignment = VerticalAlignment . Center ,
383- } . SetDock ( Dock . Left ) ,
384- new CheckBox
385- {
386- IsChecked = UnityHubNativeNetApp . Config . transparent ,
390+ Text = "Appearance" ,
387391 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
391397 ( [
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+ } ,
392417 new SettingsExpanderItem
393418 {
394419 Content = s_transparentPanel = new DockPanel
@@ -440,6 +465,24 @@ public static void MoveSelectedProjectDown()
440465 Value = UnityHubNativeNetApp . Config . blurIntensity
441466 } . OnValueChanged ( OnAcrylicIntensitySliderValueChanged ) . SetDock ( Dock . Right )
442467 ] ) . 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 )
443486 }
444487 ] ) ,
445488 new SettingsExpander
@@ -483,6 +526,13 @@ public static void MoveSelectedProjectDown()
483526 ] )
484527 ] ) ;
485528
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+
486536 public static MenuItem [ ] CreateProjectMenuItems ( Func < UnityProject > unityProjectGetter )
487537 {
488538 return
0 commit comments