From 890032a81b9790dfbf058d02dfbb6e6e28f6f049 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 23 Jul 2023 11:58:15 +0200 Subject: [PATCH] Auto-reposition window after resize caused by detection of a new device. --- app/Settings.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Settings.cs b/app/Settings.cs index efb2b9ea..fcf25280 100644 --- a/app/Settings.cs +++ b/app/Settings.cs @@ -192,8 +192,15 @@ namespace GHelper labelModel.Text = AppConfig.GetModelShort() + (ProcessHelper.IsUserAdministrator() ? "." : ""); TopMost = AppConfig.Is("topmost"); + //This will auto position the window again when it resizes. Might mess with position if people drag the window somewhere else. + this.Resize += SettingsForm_Resize; SetContextMenu(); + } + private void SettingsForm_Resize(object? sender, EventArgs e) + { + Left = Screen.FromControl(this).WorkingArea.Width - 10 - Width; + Top = Screen.FromControl(this).WorkingArea.Height - 10 - Height; } private void PanelBattery_MouseEnter(object? sender, EventArgs e)