Turbo boost dropdown

This commit is contained in:
seerge
2023-03-13 23:28:57 +01:00
parent b6b06a3802
commit dd4d85f254
4 changed files with 46 additions and 30 deletions

18
Fans.cs
View File

@@ -115,7 +115,7 @@ namespace GHelper
InitPower();
InitBoost();
checkBoost.Click += CheckBoost_Click;
comboBoost.SelectedIndexChanged += ComboBoost_Changed;
Shown += Fans_Shown;
@@ -125,19 +125,15 @@ namespace GHelper
public void InitBoost()
{
int boost = NativeMethods.GetCPUBoost();
checkBoost.Checked = (boost > 0);
if (boost >= 0)
comboBoost.SelectedIndex = boost;
}
private void CheckBoost_Click(object? sender, EventArgs e)
private void ComboBoost_Changed(object? sender, EventArgs e)
{
if (sender is null)
return;
CheckBox chk = (CheckBox)sender;
if (chk.Checked)
NativeMethods.SetCPUBoost(2);
else
NativeMethods.SetCPUBoost(0);
if (sender is null) return;
ComboBox cmb = (ComboBox)sender;
NativeMethods.SetCPUBoost(cmb.SelectedIndex);
}
private void CheckApplyPower_Click(object? sender, EventArgs e)