Skip to content

Commit

Permalink
Fixed an issue when window is maximized (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Aug 8, 2023
1 parent 70dad3c commit 078da9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Datalya/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ private void RefreshState()
MaximizeToolTip.Content = WindowState == WindowState.Maximized ? Properties.Resources.Restore : Properties.Resources.Maximize; // Set
DefineMaximumSize(); // Avoid taskbar overflow

WindowBorder.Margin = WindowState == WindowState.Maximized ? new(10, 10, 0, 0) : new(10); // Set
WindowBorder.CornerRadius = WindowState == WindowState.Maximized ? new(0) : new(5);
WindowBorder.Margin = WindowState == WindowState.Maximized ? new(5, 5, 0, 0) : new(10); // Set
}

private void TabEnter(object sender, MouseEventArgs e)
Expand Down Expand Up @@ -216,8 +217,8 @@ private void DefineMaximumSize()

double factor = scaling / 100d; // Calculate factor

MaxHeight = currentScreen.WorkingArea.Height / factor + 5; // Set max size
MaxWidth = currentScreen.WorkingArea.Width / factor + 5; // Set max size
MaxHeight = currentScreen.WorkingArea.Height / factor + 7; // Set max size
MaxWidth = currentScreen.WorkingArea.Width / factor + 7; // Set max size
}

internal void SettingsBtn_Click(object sender, RoutedEventArgs e)
Expand Down
7 changes: 4 additions & 3 deletions Datalya/Windows/HomeWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ private void DefineMaximumSize()

double factor = scaling / 100d; // Calculate factor

MaxHeight = currentScreen.WorkingArea.Height / factor + 5; // Set max size
MaxWidth = currentScreen.WorkingArea.Width / factor + 5; // Set max size
MaxHeight = currentScreen.WorkingArea.Height / factor + 7; // Set max size
MaxWidth = currentScreen.WorkingArea.Width / factor + 7; // Set max size
}

private void RefreshState()
Expand All @@ -214,7 +214,8 @@ private void RefreshState()
MaximizeToolTip.Content = WindowState == WindowState.Maximized ? Properties.Resources.Restore : Properties.Resources.Maximize; // Set
DefineMaximumSize(); // Avoid taskbar overflow

WindowBorder.Margin = WindowState == WindowState.Maximized ? new(10, 10, 0, 0) : new(10); // Set
WindowBorder.CornerRadius = WindowState == WindowState.Maximized ? new(0) : new(5);
WindowBorder.Margin = WindowState == WindowState.Maximized ? new(5, 5, 0, 0) : new(10); // Set
}

private void MinimizeBtn_Click(object sender, RoutedEventArgs e)
Expand Down

0 comments on commit 078da9b

Please sign in to comment.