Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/Privatezilla/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@ public void Globalization()
State.Text = Locale.columnState; // State column
}

private void AutoAdjustScreensize()
{
var screen = Screen.FromControl(this);
var screenSize = screen.Bounds.Size;

if (Width > screenSize.Width)
Width = screenSize.Width;

if (Height > screenSize.Height)
Height = screenSize.Height - 30; //Height -30 because of the Windows Task bar
}

public MainWindow()
{
// Uncomment lower line and add lang code to run localization test
Expand All @@ -109,6 +121,9 @@ public MainWindow()

// GUI localization
Globalization();

//Adjust to current screensize if window is too big
AutoAdjustScreensize();
}

public void InitializeSettings()
Expand Down