Skip to content

Commit

Permalink
Set maximum window height and clean up window size logging
Browse files Browse the repository at this point in the history
The height of the window is now set to the maximum primary screen height on load. This will prevent the application window from exceeding the screen height when maximized. Furthermore, the debugging log for window size changes has been removed from MainWindow.xaml.cs.
  • Loading branch information
xorza committed May 18, 2024
1 parent 0b2d768 commit 483f5cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Editor.NET/Editor.NET/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ public MainWindow() {
InitializeComponent();

this.DataContext = _viewModel;
this.SizeChanged += (sender, args) => {
Debug.WriteLine("New window size: {0}x{1}", args.NewSize.Width, args.NewSize.Height);
};

}


Expand Down
1 change: 1 addition & 0 deletions Editor.NET/Editor.NET/Styles/Window.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<Setter Property="Background" Value="{StaticResource DarkGray}" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<EventSetter Event="Loaded" Handler="Window_Loaded" />

<Setter Property="Template">
<Setter.Value>
Expand Down
5 changes: 5 additions & 0 deletions Editor.NET/Editor.NET/Styles/Window.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,9 @@ private void Header_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) {
}

#endregion

private void Window_Loaded(object sender, RoutedEventArgs e) {
var self = (Window)sender;
self.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
}
}

0 comments on commit 483f5cb

Please sign in to comment.