mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-30 05:47:38 +00:00
Fixed Issue 123.
This commit is contained in:
parent
3e65f5bfc2
commit
23a18b8589
@ -100,19 +100,25 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
nodeTextBoxMax.DrawText += nodeTextBoxText_DrawText;
|
nodeTextBoxMax.DrawText += nodeTextBoxText_DrawText;
|
||||||
nodeTextBoxText.EditorShowing += nodeTextBoxText_EditorShowing;
|
nodeTextBoxText.EditorShowing += nodeTextBoxText_EditorShowing;
|
||||||
|
|
||||||
if (settings.Contains("mainForm.Location.X")) {
|
Rectangle newBounds = new Rectangle {
|
||||||
int x = settings.GetValue("mainForm.Location.X", Location.X);
|
X = settings.GetValue("mainForm.Location.X", Location.X),
|
||||||
x = x < 0 ? 0 : x;
|
Y = settings.GetValue("mainForm.Location.Y", Location.Y),
|
||||||
int y = settings.GetValue("mainForm.Location.Y", Location.Y);
|
Width = settings.GetValue("mainForm.Width", 470),
|
||||||
y = y < 0 ? 0 : y;
|
Height = settings.GetValue("mainForm.Height", 640)
|
||||||
this.Location = new Point(x, y);
|
};
|
||||||
} else {
|
|
||||||
StartPosition = FormStartPosition.CenterScreen;
|
|
||||||
}
|
|
||||||
|
|
||||||
ClientSize = new Size(
|
Screen[] screens = Screen.AllScreens;
|
||||||
settings.GetValue("mainForm.Width", 470),
|
Rectangle totalWorkingArea = new Rectangle(int.MaxValue, int.MaxValue,
|
||||||
settings.GetValue("mainForm.Height", 640));
|
int.MinValue, int.MinValue);
|
||||||
|
|
||||||
|
foreach(Screen screen in screens)
|
||||||
|
totalWorkingArea = Rectangle.Union(totalWorkingArea, screen.Bounds);
|
||||||
|
|
||||||
|
this.Bounds = newBounds;
|
||||||
|
|
||||||
|
if (!totalWorkingArea.Contains(newBounds) ||
|
||||||
|
!settings.Contains("mainForm.Location.X"))
|
||||||
|
this.StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
|
||||||
foreach (TreeColumn column in treeView.Columns)
|
foreach (TreeColumn column in treeView.Columns)
|
||||||
column.Width = Math.Max(20, Math.Min(400,
|
column.Width = Math.Max(20, Math.Min(400,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user