From f1ae14652f09aad043425d1e100b0a600f95b777 Mon Sep 17 00:00:00 2001 From: seerge Date: Mon, 13 Mar 2023 21:20:46 +0100 Subject: [PATCH] UI tweaks --- Fans.Designer.cs | 6 +++--- HardwareMonitor.cs | 12 ++++++++++-- Settings.Designer.cs | 10 +++++----- Settings.cs | 11 ++++++----- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/Fans.Designer.cs b/Fans.Designer.cs index ff169a11..ce8773e1 100644 --- a/Fans.Designer.cs +++ b/Fans.Designer.cs @@ -268,7 +268,7 @@ panelCPU.Controls.Add(labelCPU); panelCPU.Controls.Add(label2); panelCPU.Controls.Add(trackCPU); - panelCPU.Location = new Point(184, 90); + panelCPU.Location = new Point(184, 93); panelCPU.Margin = new Padding(4); panelCPU.Name = "panelCPU"; panelCPU.Size = new Size(160, 510); @@ -315,7 +315,7 @@ panelTotal.Controls.Add(labelTotal); panelTotal.Controls.Add(label1); panelTotal.Controls.Add(trackTotal); - panelTotal.Location = new Point(16, 90); + panelTotal.Location = new Point(16, 93); panelTotal.Margin = new Padding(4); panelTotal.Name = "panelTotal"; panelTotal.Size = new Size(160, 512); @@ -362,7 +362,7 @@ // labelApplied.AutoSize = true; 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.Name = "labelApplied"; labelApplied.Size = new Size(143, 32); diff --git a/HardwareMonitor.cs b/HardwareMonitor.cs index 4c8f25c8..c5a6b118 100644 --- a/HardwareMonitor.cs +++ b/HardwareMonitor.cs @@ -24,12 +24,20 @@ public class HardwareMonitor batteryDischarge = cb.NextValue() / 1000; cb.Dispose(); - gpuTemp = GpuTemperatureProvider?.GetCurrentTemperature(); } 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() { diff --git a/Settings.Designer.cs b/Settings.Designer.cs index 5198c48f..b90bfd01 100644 --- a/Settings.Designer.cs +++ b/Settings.Designer.cs @@ -462,7 +462,7 @@ // checkGPU.AutoSize = true; 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.Name = "checkGPU"; checkGPU.Size = new Size(550, 36); @@ -581,7 +581,7 @@ // checkScreen.AutoSize = true; 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.Name = "checkScreen"; checkScreen.Size = new Size(527, 36); @@ -687,7 +687,7 @@ tableLayoutKeyboard.Name = "tableLayoutKeyboard"; tableLayoutKeyboard.RowCount = 1; tableLayoutKeyboard.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); - tableLayoutKeyboard.Size = new Size(684, 62); + tableLayoutKeyboard.Size = new Size(684, 66); tableLayoutKeyboard.TabIndex = 39; // // buttonKeyboard @@ -726,7 +726,7 @@ panelColor.Location = new Point(238, 10); panelColor.Margin = new Padding(10); panelColor.Name = "panelColor"; - panelColor.Size = new Size(208, 42); + panelColor.Size = new Size(208, 46); panelColor.TabIndex = 36; // // pictureColor2 @@ -792,7 +792,7 @@ AutoScaleMode = AutoScaleMode.Dpi; AutoSize = true; AutoSizeMode = AutoSizeMode.GrowAndShrink; - ClientSize = new Size(754, 1180); + ClientSize = new Size(754, 1217); Controls.Add(panelFooter); Controls.Add(panelBattery); Controls.Add(panelMatrix); diff --git a/Settings.cs b/Settings.cs index 4579c2ff..ff0ccaf4 100644 --- a/Settings.cs +++ b/Settings.cs @@ -541,7 +541,7 @@ namespace GHelper { int currentFrequency = NativeMethods.GetRefreshRate(); - + if (currentFrequency < 0) // Laptop screen not detected or has unknown refresh rate { InitScreen(); @@ -562,7 +562,7 @@ namespace GHelper Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive); InitScreen(); - Logger.WriteLine("Screen "+ frequency.ToString() + "Hz"); + Logger.WriteLine("Screen " + frequency.ToString() + "Hz"); } @@ -690,7 +690,8 @@ namespace GHelper if (HardwareMonitor.batteryDischarge > 0) battery = "Discharging: " + Math.Round((decimal)HardwareMonitor.batteryDischarge, 1).ToString() + "W"; - if (HardwareMonitor.gpuTemp != null) { + if (HardwareMonitor.gpuTemp != null) + { gpuTemp = $": {HardwareMonitor.gpuTemp}°C - "; } @@ -744,7 +745,7 @@ namespace GHelper Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA1, limit_total); 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.wmi.DeviceSet(ASUSWmi.PerformanceMode, PerformanceMode); - Logger.WriteLine("PerfMode " + perfName + " "+ PerformanceMode); + Logger.WriteLine("PerfMode " + perfName + " " + PerformanceMode); if (notify && (oldMode != PerformanceMode)) {