GPU Section UI fixes

This commit is contained in:
Serge
2023-06-04 23:20:37 +02:00
parent eff45c1485
commit 9f7da4c20a
2 changed files with 31 additions and 24 deletions

View File

@@ -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)

View File

@@ -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,6 +258,8 @@ namespace GHelper
contextMenuStrip.Items.Add("-"); contextMenuStrip.Items.Add("-");
if (isGpuSection)
{
var titleGPU = new ToolStripMenuItem(Properties.Strings.GPUMode); var titleGPU = new ToolStripMenuItem(Properties.Strings.GPUMode);
titleGPU.Margin = padding; titleGPU.Margin = padding;
titleGPU.Enabled = false; titleGPU.Enabled = false;
@@ -282,6 +286,8 @@ namespace GHelper
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;
} }
} }