Adjust windowsize if it exceeds the screen resolution
This commit is contained in:
parent
15ad192013
commit
66a87e9981
1 changed files with 15 additions and 0 deletions
|
@ -91,6 +91,18 @@ namespace Privatezilla
|
|||
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
|
||||
|
@ -109,6 +121,9 @@ namespace Privatezilla
|
|||
|
||||
// GUI localization
|
||||
Globalization();
|
||||
|
||||
//Adjust to current screensize if window is too big
|
||||
AutoAdjustScreensize();
|
||||
}
|
||||
|
||||
public void InitializeSettings()
|
||||
|
|
Loading…
Add table
Reference in a new issue