From b796f9f9d426d4b4ef214957576bdbcae54b4d9e Mon Sep 17 00:00:00 2001 From: Carsten Braun Date: Tue, 16 May 2023 10:41:02 +0200 Subject: [PATCH] Moved checkbox to --- app/Extra.Designer.cs | 1 + app/Extra.cs | 9 +++++++++ app/Fans.Designer.cs | 33 +++++++-------------------------- app/Fans.cs | 8 -------- 4 files changed, 17 insertions(+), 34 deletions(-) diff --git a/app/Extra.Designer.cs b/app/Extra.Designer.cs index 76a6cdcb..cbf1945d 100644 --- a/app/Extra.Designer.cs +++ b/app/Extra.Designer.cs @@ -74,6 +74,7 @@ namespace GHelper checkSleepLid = new CheckBox(); checkShutdownLid = new CheckBox(); groupOther = new GroupBox(); + checkApplyWindowsPowerMode = new CheckBox(); checkKeyboardAuto = new CheckBox(); checkUSBC = new CheckBox(); checkNoOverdrive = new CheckBox(); diff --git a/app/Extra.cs b/app/Extra.cs index 9209c3a2..eae36690 100644 --- a/app/Extra.cs +++ b/app/Extra.cs @@ -73,6 +73,7 @@ namespace GHelper checkNoOverdrive.Text = Properties.Strings.DisableOverdrive; checkTopmost.Text = Properties.Strings.WindowTop; checkUSBC.Text = Properties.Strings.OptimizedUSBC; + checkApplyWindowsPowerMode.Text = Properties.Strings.ApplyWindowsPowerPlan; labelBacklight.Text = Properties.Strings.Keyboard; labelBacklightBar.Text = Properties.Strings.Lightbar; @@ -176,6 +177,8 @@ namespace GHelper checkUSBC.Checked = (Program.config.getConfig("optimized_usbc") == 1); checkUSBC.CheckedChanged += CheckUSBC_CheckedChanged; + checkApplyWindowsPowerMode.Checked = Program.config.getConfig("auto_apply_power_plan") == 1; + int kb_brightness = Program.config.getConfig("keyboard_brightness"); trackBrightness.Value = (kb_brightness >= 0 && kb_brightness <= 3) ? kb_brightness : 3; @@ -299,5 +302,11 @@ namespace GHelper Top = Program.settingsForm.Top; Left = Program.settingsForm.Left - Width - 5; } + + private void checkApplyWindowsPowerMode_CheckedChanged(object sender, EventArgs e) + { + CheckBox chk = (CheckBox)sender; + Program.config.setConfig("auto_apply_power_plan", chk.Checked ? 1 : 0); + } } } diff --git a/app/Fans.Designer.cs b/app/Fans.Designer.cs index 3e37af29..cf092519 100644 --- a/app/Fans.Designer.cs +++ b/app/Fans.Designer.cs @@ -86,7 +86,6 @@ namespace GHelper panelTitleGPU = new Panel(); pictureGPU = new PictureBox(); labelGPU = new Label(); - checkApplyWindowsPowerPlan = new RCheckBox(); panelFans.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit(); tableFanCharts.SuspendLayout(); @@ -324,14 +323,12 @@ namespace GHelper // // panelApplyPower // - panelApplyPower.Controls.Add(checkApplyWindowsPowerPlan); panelApplyPower.Controls.Add(checkApplyPower); panelApplyPower.Dock = DockStyle.Bottom; - panelApplyPower.Location = new Point(0, 307); - panelApplyPower.Margin = new Padding(2); + panelApplyPower.Location = new Point(0, 445); panelApplyPower.Name = "panelApplyPower"; - panelApplyPower.Padding = new Padding(6); - panelApplyPower.Size = new Size(392, 98); + panelApplyPower.Padding = new Padding(10); + panelApplyPower.Size = new Size(523, 92); panelApplyPower.TabIndex = 44; // // checkApplyPower @@ -339,11 +336,11 @@ namespace GHelper checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; checkApplyPower.AutoSize = true; checkApplyPower.BackColor = SystemColors.ControlLight; - checkApplyPower.Location = new Point(10, 50); - checkApplyPower.Margin = new Padding(6); + checkApplyPower.Location = new Point(18, 22); + checkApplyPower.Margin = new Padding(10); checkApplyPower.Name = "checkApplyPower"; - checkApplyPower.Padding = new Padding(8, 3, 8, 3); - checkApplyPower.Size = new Size(205, 35); + checkApplyPower.Padding = new Padding(15, 5, 15, 5); + checkApplyPower.Size = new Size(277, 46); checkApplyPower.TabIndex = 45; checkApplyPower.Text = Properties.Strings.ApplyPowerLimits; checkApplyPower.UseVisualStyleBackColor = false; @@ -734,21 +731,6 @@ namespace GHelper labelGPU.TabIndex = 40; labelGPU.Text = "GPU Settings"; // - // checkApplyWindowsPowerPlan - // - checkApplyWindowsPowerPlan.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; - checkApplyWindowsPowerPlan.AutoSize = true; - checkApplyWindowsPowerPlan.BackColor = SystemColors.ControlLight; - checkApplyWindowsPowerPlan.Location = new Point(10, 13); - checkApplyWindowsPowerPlan.Margin = new Padding(6); - checkApplyWindowsPowerPlan.Name = "checkApplyWindowsPowerPlan"; - checkApplyWindowsPowerPlan.Padding = new Padding(8, 3, 8, 3); - checkApplyWindowsPowerPlan.Size = new Size(319, 35); - checkApplyWindowsPowerPlan.TabIndex = 46; - checkApplyWindowsPowerPlan.Text = "Auto Adjust Windows Power Plan"; - checkApplyWindowsPowerPlan.UseVisualStyleBackColor = false; - checkApplyWindowsPowerPlan.CheckedChanged += checkApplyWindowsPowerPlan_CheckedChanged; - // // Fans // AutoScaleDimensions = new SizeF(192F, 192F); @@ -860,6 +842,5 @@ namespace GHelper private Label labelGPUTemp; private Label labelGPUTempTitle; private TrackBar trackGPUTemp; - private RCheckBox checkApplyWindowsPowerPlan; } } \ No newline at end of file diff --git a/app/Fans.cs b/app/Fans.cs index 0000456a..b6cf81e7 100644 --- a/app/Fans.cs +++ b/app/Fans.cs @@ -28,7 +28,6 @@ namespace GHelper labelPowerLimits.Text = Properties.Strings.PowerLimits; labelInfo.Text = Properties.Strings.PPTExperimental; checkApplyPower.Text = Properties.Strings.ApplyPowerLimits; - checkApplyWindowsPowerPlan.Text = Properties.Strings.ApplyWindowsPowerPlan; labelFans.Text = Properties.Strings.FanCurves; labelBoost.Text = Properties.Strings.CPUBoost; @@ -378,7 +377,6 @@ namespace GHelper int limit_total; int limit_cpu; bool apply = Program.config.getConfigPerf("auto_apply_power") == 1; - bool applyPP = Program.config.getConfig("auto_apply_power_plan") == 1; if (changed) { @@ -403,7 +401,6 @@ namespace GHelper trackTotal.Value = limit_total; trackCPU.Value = limit_cpu; checkApplyPower.Checked = apply; - checkApplyWindowsPowerPlan.Checked = applyPP; labelTotal.Text = trackTotal.Value.ToString() + "W"; labelCPU.Text = trackCPU.Value.ToString() + "W"; @@ -692,11 +689,6 @@ namespace GHelper } } - private void checkApplyWindowsPowerPlan_CheckedChanged(object sender, EventArgs e) - { - CheckBox chk = (CheckBox)sender; - Program.config.setConfig("auto_apply_power_plan", chk.Checked ? 1 : 0); - } } }