Hide GPU fans from UI if they don't exist in system

This commit is contained in:
Serge
2023-05-24 23:47:08 +02:00
parent e765b4f037
commit f36fb6ca55
3 changed files with 12 additions and 7 deletions

View File

@@ -16,7 +16,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.69</AssemblyVersion>
<AssemblyVersion>0.70</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -255,7 +255,7 @@ namespace GHelper
//
sliderBattery.Location = new Point(16, 70);
sliderBattery.Max = 100;
sliderBattery.Min = 50;
sliderBattery.Min = 40;
sliderBattery.Name = "sliderBattery";
sliderBattery.Size = new Size(772, 40);
sliderBattery.TabIndex = 39;

View File

@@ -953,10 +953,11 @@ namespace GHelper
labelBattery.Text = battery;
});
string trayTip = "CPU" + cpuTemp + HardwareControl.cpuFan;
if (gpuTemp.Length > 0) trayTip += "\nGPU" + gpuTemp + HardwareControl.gpuFan;
if (battery.Length > 0) trayTip += "\n" + battery;
Program.trayIcon.Text = "CPU" + cpuTemp + HardwareControl.cpuFan + "\n"
+ "GPU" + gpuTemp + HardwareControl.gpuFan +
((battery.Length > 0) ? ("\n" + battery) : "");
Program.trayIcon.Text = trayTip;
}
@@ -1432,8 +1433,12 @@ namespace GHelper
GpuMode = AsusACPI.GPUModeStandard;
UltimateUI(mux == 1);
if (eco < 0) tableGPU.Visible = false;
if (eco < 0)
{
tableGPU.Visible = false;
if (Program.acpi.DeviceGet(AsusACPI.GPU_Fan) < 0 ) panelGPU.Visible = false;
}
}