mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
GPU Section UI fixes
This commit is contained in:
@@ -31,7 +31,7 @@ public static class HardwareControl
|
|||||||
{
|
{
|
||||||
AppConfig.setConfig("fan_max", fan);
|
AppConfig.setConfig("fan_max", fan);
|
||||||
}
|
}
|
||||||
private static string FormatFan(int fan)
|
public static string FormatFan(int fan)
|
||||||
{
|
{
|
||||||
// fix for old models
|
// fix for old models
|
||||||
if (fan < 0)
|
if (fan < 0)
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ namespace GHelper
|
|||||||
private bool customFans = false;
|
private bool customFans = false;
|
||||||
private int customPower = 0;
|
private int customPower = 0;
|
||||||
|
|
||||||
|
bool isGpuSection = true;
|
||||||
|
|
||||||
public SettingsForm()
|
public SettingsForm()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -256,32 +258,36 @@ namespace GHelper
|
|||||||
|
|
||||||
contextMenuStrip.Items.Add("-");
|
contextMenuStrip.Items.Add("-");
|
||||||
|
|
||||||
var titleGPU = new ToolStripMenuItem(Properties.Strings.GPUMode);
|
if (isGpuSection)
|
||||||
titleGPU.Margin = padding;
|
{
|
||||||
titleGPU.Enabled = false;
|
var titleGPU = new ToolStripMenuItem(Properties.Strings.GPUMode);
|
||||||
contextMenuStrip.Items.Add(titleGPU);
|
titleGPU.Margin = padding;
|
||||||
|
titleGPU.Enabled = false;
|
||||||
|
contextMenuStrip.Items.Add(titleGPU);
|
||||||
|
|
||||||
menuEco = new ToolStripMenuItem(Properties.Strings.EcoMode);
|
menuEco = new ToolStripMenuItem(Properties.Strings.EcoMode);
|
||||||
menuEco.Click += ButtonEco_Click;
|
menuEco.Click += ButtonEco_Click;
|
||||||
menuEco.Margin = padding;
|
menuEco.Margin = padding;
|
||||||
contextMenuStrip.Items.Add(menuEco);
|
contextMenuStrip.Items.Add(menuEco);
|
||||||
|
|
||||||
menuStandard = new ToolStripMenuItem(Properties.Strings.StandardMode);
|
menuStandard = new ToolStripMenuItem(Properties.Strings.StandardMode);
|
||||||
menuStandard.Click += ButtonStandard_Click;
|
menuStandard.Click += ButtonStandard_Click;
|
||||||
menuStandard.Margin = padding;
|
menuStandard.Margin = padding;
|
||||||
contextMenuStrip.Items.Add(menuStandard);
|
contextMenuStrip.Items.Add(menuStandard);
|
||||||
|
|
||||||
menuUltimate = new ToolStripMenuItem(Properties.Strings.UltimateMode);
|
menuUltimate = new ToolStripMenuItem(Properties.Strings.UltimateMode);
|
||||||
menuUltimate.Click += ButtonUltimate_Click;
|
menuUltimate.Click += ButtonUltimate_Click;
|
||||||
menuUltimate.Margin = padding;
|
menuUltimate.Margin = padding;
|
||||||
contextMenuStrip.Items.Add(menuUltimate);
|
contextMenuStrip.Items.Add(menuUltimate);
|
||||||
|
|
||||||
menuOptimized = new ToolStripMenuItem(Properties.Strings.Optimized);
|
menuOptimized = new ToolStripMenuItem(Properties.Strings.Optimized);
|
||||||
menuOptimized.Click += ButtonOptimized_Click;
|
menuOptimized.Click += ButtonOptimized_Click;
|
||||||
menuOptimized.Margin = padding;
|
menuOptimized.Margin = padding;
|
||||||
contextMenuStrip.Items.Add(menuOptimized);
|
contextMenuStrip.Items.Add(menuOptimized);
|
||||||
|
|
||||||
|
contextMenuStrip.Items.Add("-");
|
||||||
|
}
|
||||||
|
|
||||||
contextMenuStrip.Items.Add("-");
|
|
||||||
|
|
||||||
var quit = new ToolStripMenuItem(Properties.Strings.Quit);
|
var quit = new ToolStripMenuItem(Properties.Strings.Quit);
|
||||||
quit.Click += ButtonQuit_Click;
|
quit.Click += ButtonQuit_Click;
|
||||||
@@ -1470,8 +1476,9 @@ namespace GHelper
|
|||||||
|
|
||||||
if (eco < 0)
|
if (eco < 0)
|
||||||
{
|
{
|
||||||
tableGPU.Visible = false;
|
isGpuSection = tableGPU.Visible = false;
|
||||||
if (Program.acpi.DeviceGet(AsusACPI.GPU_Fan) < -65536) panelGPU.Visible = false;
|
SetContextMenu();
|
||||||
|
if (HardwareControl.FormatFan(Program.acpi.DeviceGet(AsusACPI.GPU_Fan)) is null) panelGPU.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user