From ea2e8a7c24da2a747105ee17ce9ec744e047e0fa Mon Sep 17 00:00:00 2001 From: seerge Date: Sun, 12 Mar 2023 13:27:44 +0100 Subject: [PATCH] UI Tweaks --- Fans.Designer.cs | 55 ++++++++++++++++++++++++------ GHelper.csproj | 2 +- NativeMethods.cs | 6 ++++ Properties/Resources.Designer.cs | 10 ++++++ Properties/Resources.resx | 7 ++-- Resources/icons8-processor-96.png | Bin 0 -> 710 bytes Settings.cs | 6 +++- 7 files changed, 71 insertions(+), 15 deletions(-) create mode 100644 Resources/icons8-processor-96.png diff --git a/Fans.Designer.cs b/Fans.Designer.cs index b677837b..ff169a11 100644 --- a/Fans.Designer.cs +++ b/Fans.Designer.cs @@ -28,9 +28,10 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); + System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); panelFans = new Panel(); + picturePerf = new PictureBox(); tableFanCharts = new TableLayoutPanel(); chartGPU = new System.Windows.Forms.DataVisualization.Charting.Chart(); chartCPU = new System.Windows.Forms.DataVisualization.Charting.Chart(); @@ -40,6 +41,7 @@ buttonReset = new Button(); buttonApply = new Button(); panelPower = new Panel(); + pictureBox1 = new PictureBox(); labelPowerLimits = new Label(); checkApplyPower = new CheckBox(); buttonApplyPower = new Button(); @@ -55,10 +57,12 @@ pictureFine = new PictureBox(); labelInfo = new Label(); panelFans.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit(); tableFanCharts.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit(); ((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit(); panelPower.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); panelCPU.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)trackCPU).BeginInit(); panelTotal.SuspendLayout(); @@ -68,6 +72,7 @@ // // panelFans // + panelFans.Controls.Add(picturePerf); panelFans.Controls.Add(tableFanCharts); panelFans.Controls.Add(checkBoost); panelFans.Controls.Add(labelFans); @@ -77,12 +82,23 @@ panelFans.Dock = DockStyle.Left; panelFans.Location = new Point(364, 0); panelFans.Margin = new Padding(0); - panelFans.MinimumSize = new Size(824, 1098); panelFans.Name = "panelFans"; panelFans.Padding = new Padding(20); panelFans.Size = new Size(824, 1159); panelFans.TabIndex = 12; // + // picturePerf + // + picturePerf.BackgroundImage = Properties.Resources.icons8_fan_head_96; + picturePerf.BackgroundImageLayout = ImageLayout.Zoom; + picturePerf.InitialImage = null; + picturePerf.Location = new Point(30, 18); + picturePerf.Margin = new Padding(4, 2, 4, 2); + picturePerf.Name = "picturePerf"; + picturePerf.Size = new Size(36, 38); + picturePerf.TabIndex = 37; + picturePerf.TabStop = false; + // // tableFanCharts // tableFanCharts.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; @@ -103,8 +119,8 @@ // // chartGPU // - chartArea3.Name = "ChartArea1"; - chartGPU.ChartAreas.Add(chartArea3); + chartArea1.Name = "ChartArea1"; + chartGPU.ChartAreas.Add(chartArea1); chartGPU.Dock = DockStyle.Fill; chartGPU.Location = new Point(2, 504); chartGPU.Margin = new Padding(2, 10, 2, 10); @@ -115,8 +131,8 @@ // // chartCPU // - chartArea4.Name = "ChartArea1"; - chartCPU.ChartAreas.Add(chartArea4); + chartArea2.Name = "ChartArea1"; + chartCPU.ChartAreas.Add(chartArea2); chartCPU.Dock = DockStyle.Fill; chartCPU.Location = new Point(2, 10); chartCPU.Margin = new Padding(2, 10, 2, 10); @@ -141,7 +157,7 @@ // labelFans.AutoSize = true; labelFans.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); - labelFans.Location = new Point(28, 20); + labelFans.Location = new Point(66, 20); labelFans.Margin = new Padding(4, 0, 4, 0); labelFans.Name = "labelFans"; labelFans.Size = new Size(138, 32); @@ -184,6 +200,7 @@ // // panelPower // + panelPower.Controls.Add(pictureBox1); panelPower.Controls.Add(labelPowerLimits); panelPower.Controls.Add(checkApplyPower); panelPower.Controls.Add(buttonApplyPower); @@ -200,11 +217,23 @@ panelPower.Size = new Size(364, 1159); panelPower.TabIndex = 13; // + // pictureBox1 + // + pictureBox1.BackgroundImage = Properties.Resources.icons8_processor_96; + pictureBox1.BackgroundImageLayout = ImageLayout.Zoom; + pictureBox1.InitialImage = null; + pictureBox1.Location = new Point(20, 18); + pictureBox1.Margin = new Padding(4, 2, 4, 2); + pictureBox1.Name = "pictureBox1"; + pictureBox1.Size = new Size(36, 38); + pictureBox1.TabIndex = 38; + pictureBox1.TabStop = false; + // // labelPowerLimits // labelPowerLimits.AutoSize = true; labelPowerLimits.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); - labelPowerLimits.Location = new Point(24, 20); + labelPowerLimits.Location = new Point(54, 20); labelPowerLimits.Margin = new Padding(4, 0, 4, 0); labelPowerLimits.Name = "labelPowerLimits"; labelPowerLimits.Size = new Size(229, 32); @@ -333,7 +362,7 @@ // labelApplied.AutoSize = true; labelApplied.ForeColor = Color.Tomato; - labelApplied.Location = new Point(24, 54); + labelApplied.Location = new Point(56, 48); labelApplied.Margin = new Padding(4, 0, 4, 0); labelApplied.Name = "labelApplied"; labelApplied.Size = new Size(143, 32); @@ -369,7 +398,7 @@ AutoScaleMode = AutoScaleMode.Dpi; AutoSize = true; AutoSizeMode = AutoSizeMode.GrowAndShrink; - ClientSize = new Size(1188, 1159); + ClientSize = new Size(1178, 1159); Controls.Add(panelFans); Controls.Add(panelPower); Margin = new Padding(4, 2, 4, 2); @@ -384,11 +413,13 @@ Text = "Fans and Power"; panelFans.ResumeLayout(false); panelFans.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)picturePerf).EndInit(); tableFanCharts.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)chartGPU).EndInit(); ((System.ComponentModel.ISupportInitialize)chartCPU).EndInit(); panelPower.ResumeLayout(false); panelPower.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); panelCPU.ResumeLayout(false); panelCPU.PerformLayout(); ((System.ComponentModel.ISupportInitialize)trackCPU).EndInit(); @@ -424,5 +455,7 @@ private System.Windows.Forms.DataVisualization.Charting.Chart chartCPU; private CheckBox checkBoost; private Label labelFans; + private PictureBox picturePerf; + private PictureBox pictureBox1; } } \ No newline at end of file diff --git a/GHelper.csproj b/GHelper.csproj index 2414a0d9..ed4be555 100644 --- a/GHelper.csproj +++ b/GHelper.csproj @@ -16,7 +16,7 @@ x64 False True - 0.23 + 0.24 diff --git a/NativeMethods.cs b/NativeMethods.cs index 69f22a8e..f207b6af 100644 --- a/NativeMethods.cs +++ b/NativeMethods.cs @@ -491,17 +491,23 @@ public class NativeMethods foreach (var device in devices) { if (device.outputTechnology == DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY.DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL) + { displayNum = count; + laptopScreen = device.monitorDevicePath; + } count++; //Debug.WriteLine(device.outputTechnology); //Debug.WriteLine(device.monitorFriendlyDeviceName); } + count = 0; foreach (var screen in Screen.AllScreens) { if (count == displayNum) + { laptopScreen = screen.DeviceName; + } //Debug.WriteLine(screen.DeviceName); count++; } diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index af44bc02..82636674 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -130,6 +130,16 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_processor_96 { + get { + object obj = ResourceManager.GetObject("icons8-processor-96", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/Properties/Resources.resx b/Properties/Resources.resx index f8966b05..c08865b5 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -121,6 +121,9 @@ ..\Resources\eco.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\icons8-matrix-desktop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\icons8-keyboard-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -151,7 +154,7 @@ ..\Resources\icons8-laptop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\icons8-matrix-desktop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\icons8-processor-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/Resources/icons8-processor-96.png b/Resources/icons8-processor-96.png new file mode 100644 index 0000000000000000000000000000000000000000..a7718dfd7ba3ac3c5f3c551c02a45068f506b23a GIT binary patch literal 710 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGooCO|{#S9GG!XV7ZFl&wk0|Qfq zr;B4q#hkZueeu`dYsc^9+C7|eCw6Ch64${ z{Oj+{{kW~B9oJ~Lspe9llOJR{Y1<()OPtcEkU$yTRZFM7gsK)ca#+Sm4hBJHRQst^AK26J=tiSuvl@ed?tz zHY8ZRuLx@A<6c&He6p3gdbG6F>xWDFZUq#~xdJrx{?(;sA}5(NR`4FZ$Ot4DZU^k$ z(AmJ=^!IwzHKrp|tWUFDMebAS$tkxlCi#~-`nQFP`wPyg z6$VAEhTANr8!n6{N?j9|iGpJDNRfZ~Bw*~CTdSG*oAk{KT)Qbev|Rp2_QBr_j}LuV isrA|dnotBd4%9n7_gEgKr0xMsm<*n-elF{r5}E)sav~A{ literal 0 HcmV?d00001 diff --git a/Settings.cs b/Settings.cs index 3dac452a..1acdeca6 100644 --- a/Settings.cs +++ b/Settings.cs @@ -836,8 +836,12 @@ namespace GHelper { SetEcoGPU(1); } - + else + { + AutoScreen(Plugged); + } } + } public int InitGPUMode()