diff --git a/app/Fans.cs b/app/Fans.cs index c36584ca..ddae532b 100644 --- a/app/Fans.cs +++ b/app/Fans.cs @@ -466,7 +466,6 @@ namespace GHelper chartMid.Visible = true; SetChart(chartMid, AsusFan.Mid); LoadProfile(seriesMid, AsusFan.Mid); - Size = MinimumSize = new Size(0, chartCount * 400 + 200); } else { @@ -481,13 +480,22 @@ namespace GHelper chartXGM.Visible = true; SetChart(chartXGM, AsusFan.XGM); LoadProfile(seriesXGM, AsusFan.XGM); - Size = MinimumSize = new Size(0, chartCount * 400 + 200); } else { AppConfig.setConfig("xgm_fan", 0); } + try + { + if (chartCount > 2) + Size = MinimumSize = new Size(0, (int)(ControlHelper.GetDpiScale(this).Value * (chartCount * 200 + 100))); + } catch (Exception ex) + { + Debug.WriteLine(ex); + } + + SetChart(chartCPU, AsusFan.CPU); SetChart(chartGPU, AsusFan.GPU); diff --git a/app/InputDispatcher.cs b/app/InputDispatcher.cs index c7a9d063..a133dc24 100644 --- a/app/InputDispatcher.cs +++ b/app/InputDispatcher.cs @@ -60,10 +60,11 @@ namespace GHelper private static nint windowHandle; public static Keys keyProfile = Keys.F5; + public static Keys keyApp = Keys.F12; KeyboardListener listener; - KeyHandler m1, m2, togggle; + KeyHandler m1, m2, handlerProfile, handlerApp; public InputDispatcher(nint handle) { @@ -76,11 +77,12 @@ namespace GHelper Program.acpi.SubscribeToEvents(WatcherEventArrived); //Task.Run(Program.acpi.RunListener); - // CTRL + SHIFT + F5 to cycle profiles if (AppConfig.getConfig("keybind_profile") != -1) keyProfile = (Keys)AppConfig.getConfig("keybind_profile"); - togggle = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, keyProfile, windowHandle); + handlerProfile = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, keyProfile, windowHandle); + handlerApp = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, keyApp, windowHandle); + m1 = new KeyHandler(KeyHandler.NOMOD, Keys.VolumeDown, windowHandle); m2 = new KeyHandler(KeyHandler.NOMOD, Keys.VolumeUp, windowHandle); @@ -144,24 +146,16 @@ namespace GHelper string actionM1 = AppConfig.getConfigString("m1"); string actionM2 = AppConfig.getConfigString("m2"); - togggle.Unregiser(); + handlerProfile.Unregiser(); m1.Unregiser(); m2.Unregiser(); - if (keyProfile != Keys.None) - { - togggle.Register(); - } + if (keyProfile != Keys.None) handlerProfile.Register(); + if (keyApp != Keys.None) handlerApp.Register(); - if (actionM1 is not null && actionM1.Length > 0) - { - m1.Register(); - } + if (actionM1 is not null && actionM1.Length > 0) m1.Register(); - if (actionM2 is not null && actionM2.Length > 0) - { - m2.Register(); - } + if (actionM2 is not null && actionM2.Length > 0) m2.Register(); } diff --git a/app/Settings.cs b/app/Settings.cs index da64e847..6fd002d8 100644 --- a/app/Settings.cs +++ b/app/Settings.cs @@ -194,6 +194,7 @@ namespace GHelper break; default: if (key == InputDispatcher.keyProfile) CyclePerformanceMode(); + if (key == InputDispatcher.keyApp) Program.SettingsToggle(); break; }