UI tweaks

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

6
Fans.Designer.cs generated
View File

@@ -268,7 +268,7 @@
panelCPU.Controls.Add(labelCPU); panelCPU.Controls.Add(labelCPU);
panelCPU.Controls.Add(label2); panelCPU.Controls.Add(label2);
panelCPU.Controls.Add(trackCPU); panelCPU.Controls.Add(trackCPU);
panelCPU.Location = new Point(184, 90); panelCPU.Location = new Point(184, 93);
panelCPU.Margin = new Padding(4); panelCPU.Margin = new Padding(4);
panelCPU.Name = "panelCPU"; panelCPU.Name = "panelCPU";
panelCPU.Size = new Size(160, 510); panelCPU.Size = new Size(160, 510);
@@ -315,7 +315,7 @@
panelTotal.Controls.Add(labelTotal); panelTotal.Controls.Add(labelTotal);
panelTotal.Controls.Add(label1); panelTotal.Controls.Add(label1);
panelTotal.Controls.Add(trackTotal); panelTotal.Controls.Add(trackTotal);
panelTotal.Location = new Point(16, 90); panelTotal.Location = new Point(16, 93);
panelTotal.Margin = new Padding(4); panelTotal.Margin = new Padding(4);
panelTotal.Name = "panelTotal"; panelTotal.Name = "panelTotal";
panelTotal.Size = new Size(160, 512); panelTotal.Size = new Size(160, 512);
@@ -362,7 +362,7 @@
// //
labelApplied.AutoSize = true; labelApplied.AutoSize = true;
labelApplied.ForeColor = Color.Tomato; labelApplied.ForeColor = Color.Tomato;
labelApplied.Location = new Point(56, 48); labelApplied.Location = new Point(56, 54);
labelApplied.Margin = new Padding(4, 0, 4, 0); labelApplied.Margin = new Padding(4, 0, 4, 0);
labelApplied.Name = "labelApplied"; labelApplied.Name = "labelApplied";
labelApplied.Size = new Size(143, 32); labelApplied.Size = new Size(143, 32);

View File

@@ -24,12 +24,20 @@ public class HardwareMonitor
batteryDischarge = cb.NextValue() / 1000; batteryDischarge = cb.NextValue() / 1000;
cb.Dispose(); cb.Dispose();
gpuTemp = GpuTemperatureProvider?.GetCurrentTemperature();
} }
catch catch
{ {
Logger.WriteLine("Failed reading sensors"); //Logger.WriteLine("Failed reading sensors");
} }
try
{
gpuTemp = GpuTemperatureProvider?.GetCurrentTemperature();
} catch
{
//Logger.WriteLine("Failed reading GPU temps");
}
} }
public static void RecreateGpuTemperatureProvider() { public static void RecreateGpuTemperatureProvider() {

10
Settings.Designer.cs generated
View File

@@ -462,7 +462,7 @@
// //
checkGPU.AutoSize = true; checkGPU.AutoSize = true;
checkGPU.ForeColor = SystemColors.GrayText; checkGPU.ForeColor = SystemColors.GrayText;
checkGPU.Location = new Point(27, 154); checkGPU.Location = new Point(27, 155);
checkGPU.Margin = new Padding(4, 2, 4, 2); checkGPU.Margin = new Padding(4, 2, 4, 2);
checkGPU.Name = "checkGPU"; checkGPU.Name = "checkGPU";
checkGPU.Size = new Size(550, 36); checkGPU.Size = new Size(550, 36);
@@ -581,7 +581,7 @@
// //
checkScreen.AutoSize = true; checkScreen.AutoSize = true;
checkScreen.ForeColor = SystemColors.GrayText; checkScreen.ForeColor = SystemColors.GrayText;
checkScreen.Location = new Point(27, 153); checkScreen.Location = new Point(27, 154);
checkScreen.Margin = new Padding(4, 2, 4, 2); checkScreen.Margin = new Padding(4, 2, 4, 2);
checkScreen.Name = "checkScreen"; checkScreen.Name = "checkScreen";
checkScreen.Size = new Size(527, 36); checkScreen.Size = new Size(527, 36);
@@ -687,7 +687,7 @@
tableLayoutKeyboard.Name = "tableLayoutKeyboard"; tableLayoutKeyboard.Name = "tableLayoutKeyboard";
tableLayoutKeyboard.RowCount = 1; tableLayoutKeyboard.RowCount = 1;
tableLayoutKeyboard.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutKeyboard.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
tableLayoutKeyboard.Size = new Size(684, 62); tableLayoutKeyboard.Size = new Size(684, 66);
tableLayoutKeyboard.TabIndex = 39; tableLayoutKeyboard.TabIndex = 39;
// //
// buttonKeyboard // buttonKeyboard
@@ -726,7 +726,7 @@
panelColor.Location = new Point(238, 10); panelColor.Location = new Point(238, 10);
panelColor.Margin = new Padding(10); panelColor.Margin = new Padding(10);
panelColor.Name = "panelColor"; panelColor.Name = "panelColor";
panelColor.Size = new Size(208, 42); panelColor.Size = new Size(208, 46);
panelColor.TabIndex = 36; panelColor.TabIndex = 36;
// //
// pictureColor2 // pictureColor2
@@ -792,7 +792,7 @@
AutoScaleMode = AutoScaleMode.Dpi; AutoScaleMode = AutoScaleMode.Dpi;
AutoSize = true; AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink; AutoSizeMode = AutoSizeMode.GrowAndShrink;
ClientSize = new Size(754, 1180); ClientSize = new Size(754, 1217);
Controls.Add(panelFooter); Controls.Add(panelFooter);
Controls.Add(panelBattery); Controls.Add(panelBattery);
Controls.Add(panelMatrix); Controls.Add(panelMatrix);

View File

@@ -541,7 +541,7 @@ namespace GHelper
{ {
int currentFrequency = NativeMethods.GetRefreshRate(); int currentFrequency = NativeMethods.GetRefreshRate();
if (currentFrequency < 0) // Laptop screen not detected or has unknown refresh rate if (currentFrequency < 0) // Laptop screen not detected or has unknown refresh rate
{ {
InitScreen(); InitScreen();
@@ -562,7 +562,7 @@ namespace GHelper
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive); Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive);
InitScreen(); InitScreen();
Logger.WriteLine("Screen "+ frequency.ToString() + "Hz"); Logger.WriteLine("Screen " + frequency.ToString() + "Hz");
} }
@@ -690,7 +690,8 @@ namespace GHelper
if (HardwareMonitor.batteryDischarge > 0) if (HardwareMonitor.batteryDischarge > 0)
battery = "Discharging: " + Math.Round((decimal)HardwareMonitor.batteryDischarge, 1).ToString() + "W"; battery = "Discharging: " + Math.Round((decimal)HardwareMonitor.batteryDischarge, 1).ToString() + "W";
if (HardwareMonitor.gpuTemp != null) { if (HardwareMonitor.gpuTemp != null)
{
gpuTemp = $": {HardwareMonitor.gpuTemp}°C - "; gpuTemp = $": {HardwareMonitor.gpuTemp}°C - ";
} }
@@ -744,7 +745,7 @@ namespace GHelper
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA1, limit_total); Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA1, limit_total);
Program.wmi.DeviceSet(ASUSWmi.PPT_CPUB0, limit_cpu); Program.wmi.DeviceSet(ASUSWmi.PPT_CPUB0, limit_cpu);
Logger.WriteLine("PowerLimits "+limit_total.ToString() + ", " + limit_cpu.ToString()); Logger.WriteLine("PowerLimits " + limit_total.ToString() + ", " + limit_cpu.ToString());
} }
@@ -802,7 +803,7 @@ namespace GHelper
Program.config.setConfig("performance_mode", PerformanceMode); Program.config.setConfig("performance_mode", PerformanceMode);
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, PerformanceMode); Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, PerformanceMode);
Logger.WriteLine("PerfMode " + perfName + " "+ PerformanceMode); Logger.WriteLine("PerfMode " + perfName + " " + PerformanceMode);
if (notify && (oldMode != PerformanceMode)) if (notify && (oldMode != PerformanceMode))
{ {