UI tweaks

This commit is contained in:
Serge
2023-06-05 22:32:50 +02:00
parent 4bbfbd0382
commit 678f4b0eb7
6 changed files with 434 additions and 306 deletions

View File

@@ -1,5 +1,4 @@
using GHelper; using System.Management;
using System.Management;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
public enum AsusFan public enum AsusFan
@@ -93,6 +92,7 @@ public class AsusACPI
public const int PerformanceBalanced = 0; public const int PerformanceBalanced = 0;
public const int PerformanceTurbo = 1; public const int PerformanceTurbo = 1;
public const int PerformanceSilent = 2; public const int PerformanceSilent = 2;
public const int PerformanceManual = 4;
public const int GPUModeEco = 0; public const int GPUModeEco = 0;
public const int GPUModeStandard = 1; public const int GPUModeStandard = 1;
@@ -420,6 +420,24 @@ public class AsusACPI
return DeviceGet(PPT_CPUB0) >= 0 && DeviceGet(PPT_GPUC0) < 0; return DeviceGet(PPT_CPUB0) >= 0 && DeviceGet(PPT_GPUC0) < 0;
} }
public void ScanRange()
{
int value;
string appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\GHelper";
string logFile = appPath + "\\scan.txt";
for (uint i = 0x00000000; i <= 0x00160000; i++)
{
value = DeviceGet(i);
if (value >= 0)
using (StreamWriter w = File.AppendText(logFile))
{
w.WriteLine(i.ToString("X8") + ": " + value.ToString("X4") + " (" + value + ")");
w.Close();
}
}
}
public void TUFKeyboardBrightness(int brightness) public void TUFKeyboardBrightness(int brightness)
{ {
int param = 0x80 | (brightness & 0x7F); int param = 0x80 | (brightness & 0x7F);

641
app/Settings.Designer.cs generated

File diff suppressed because it is too large Load Diff

View File

@@ -1203,6 +1203,8 @@ namespace GHelper
bool applyPower = AppConfig.getConfigPerf("auto_apply_power") == 1; bool applyPower = AppConfig.getConfigPerf("auto_apply_power") == 1;
bool applyGPU = true; bool applyGPU = true;
//if (applyPower) Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AsusACPI.PerformanceManual, "CustomMode");
if (delay > 0) if (delay > 0)
{ {
var timer = new System.Timers.Timer(delay); var timer = new System.Timers.Timer(delay);

View File

@@ -50,25 +50,27 @@
// tableBios // tableBios
// //
tableBios.AutoSize = true; tableBios.AutoSize = true;
tableBios.AutoSizeMode = AutoSizeMode.GrowAndShrink;
tableBios.ColumnCount = 3; tableBios.ColumnCount = 3;
tableBios.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); tableBios.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableBios.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); tableBios.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
tableBios.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); tableBios.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableBios.Dock = DockStyle.Fill; tableBios.Dock = DockStyle.Top;
tableBios.Location = new Point(20, 20); tableBios.Location = new Point(10, 10);
tableBios.MinimumSize = new Size(1100, 0); tableBios.Margin = new Padding(2);
tableBios.MinimumSize = new Size(550, 0);
tableBios.Name = "tableBios"; tableBios.Name = "tableBios";
tableBios.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); tableBios.Size = new Size(608, 0);
tableBios.Size = new Size(1138, 0);
tableBios.TabIndex = 0; tableBios.TabIndex = 0;
// //
// labelBIOS // labelBIOS
// //
labelBIOS.AutoSize = true; labelBIOS.AutoSize = true;
labelBIOS.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelBIOS.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelBIOS.Location = new Point(67, 27); labelBIOS.Location = new Point(34, 14);
labelBIOS.Margin = new Padding(2, 0, 2, 0);
labelBIOS.Name = "labelBIOS"; labelBIOS.Name = "labelBIOS";
labelBIOS.Size = new Size(68, 32); labelBIOS.Size = new Size(35, 15);
labelBIOS.TabIndex = 1; labelBIOS.TabIndex = 1;
labelBIOS.Text = "BIOS"; labelBIOS.Text = "BIOS";
// //
@@ -76,9 +78,10 @@
// //
pictureBios.BackgroundImage = (Image)resources.GetObject("pictureBios.BackgroundImage"); pictureBios.BackgroundImage = (Image)resources.GetObject("pictureBios.BackgroundImage");
pictureBios.BackgroundImageLayout = ImageLayout.Zoom; pictureBios.BackgroundImageLayout = ImageLayout.Zoom;
pictureBios.Location = new Point(29, 27); pictureBios.Location = new Point(14, 14);
pictureBios.Margin = new Padding(2);
pictureBios.Name = "pictureBios"; pictureBios.Name = "pictureBios";
pictureBios.Size = new Size(32, 32); pictureBios.Size = new Size(16, 16);
pictureBios.TabIndex = 2; pictureBios.TabIndex = 2;
pictureBios.TabStop = false; pictureBios.TabStop = false;
// //
@@ -88,8 +91,9 @@
panelBiosTitle.Controls.Add(pictureBios); panelBiosTitle.Controls.Add(pictureBios);
panelBiosTitle.Dock = DockStyle.Top; panelBiosTitle.Dock = DockStyle.Top;
panelBiosTitle.Location = new Point(0, 0); panelBiosTitle.Location = new Point(0, 0);
panelBiosTitle.Margin = new Padding(2);
panelBiosTitle.Name = "panelBiosTitle"; panelBiosTitle.Name = "panelBiosTitle";
panelBiosTitle.Size = new Size(1178, 62); panelBiosTitle.Size = new Size(628, 31);
panelBiosTitle.TabIndex = 3; panelBiosTitle.TabIndex = 3;
// //
// panelBios // panelBios
@@ -97,10 +101,11 @@
panelBios.AutoSize = true; panelBios.AutoSize = true;
panelBios.Controls.Add(tableBios); panelBios.Controls.Add(tableBios);
panelBios.Dock = DockStyle.Top; panelBios.Dock = DockStyle.Top;
panelBios.Location = new Point(0, 62); panelBios.Location = new Point(0, 31);
panelBios.Margin = new Padding(2);
panelBios.Name = "panelBios"; panelBios.Name = "panelBios";
panelBios.Padding = new Padding(20); panelBios.Padding = new Padding(10);
panelBios.Size = new Size(1178, 40); panelBios.Size = new Size(628, 20);
panelBios.TabIndex = 4; panelBios.TabIndex = 4;
// //
// panelDrivers // panelDrivers
@@ -108,25 +113,27 @@
panelDrivers.AutoSize = true; panelDrivers.AutoSize = true;
panelDrivers.Controls.Add(tableDrivers); panelDrivers.Controls.Add(tableDrivers);
panelDrivers.Dock = DockStyle.Top; panelDrivers.Dock = DockStyle.Top;
panelDrivers.Location = new Point(0, 146); panelDrivers.Location = new Point(0, 73);
panelDrivers.Margin = new Padding(2);
panelDrivers.Name = "panelDrivers"; panelDrivers.Name = "panelDrivers";
panelDrivers.Padding = new Padding(20); panelDrivers.Padding = new Padding(10);
panelDrivers.Size = new Size(1178, 40); panelDrivers.Size = new Size(628, 20);
panelDrivers.TabIndex = 6; panelDrivers.TabIndex = 6;
// //
// tableDrivers // tableDrivers
// //
tableDrivers.AutoSize = true; tableDrivers.AutoSize = true;
tableDrivers.AutoSizeMode = AutoSizeMode.GrowAndShrink;
tableDrivers.ColumnCount = 3; tableDrivers.ColumnCount = 3;
tableDrivers.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); tableDrivers.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableDrivers.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); tableDrivers.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
tableDrivers.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); tableDrivers.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableDrivers.Dock = DockStyle.Fill; tableDrivers.Dock = DockStyle.Top;
tableDrivers.Location = new Point(20, 20); tableDrivers.Location = new Point(10, 10);
tableDrivers.MinimumSize = new Size(1100, 0); tableDrivers.Margin = new Padding(2);
tableDrivers.MinimumSize = new Size(550, 0);
tableDrivers.Name = "tableDrivers"; tableDrivers.Name = "tableDrivers";
tableDrivers.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); tableDrivers.Size = new Size(608, 0);
tableDrivers.Size = new Size(1138, 0);
tableDrivers.TabIndex = 0; tableDrivers.TabIndex = 0;
// //
// panelDriversTitle // panelDriversTitle
@@ -134,18 +141,20 @@
panelDriversTitle.Controls.Add(labelDrivers); panelDriversTitle.Controls.Add(labelDrivers);
panelDriversTitle.Controls.Add(pictureDrivers); panelDriversTitle.Controls.Add(pictureDrivers);
panelDriversTitle.Dock = DockStyle.Top; panelDriversTitle.Dock = DockStyle.Top;
panelDriversTitle.Location = new Point(0, 102); panelDriversTitle.Location = new Point(0, 51);
panelDriversTitle.Margin = new Padding(2);
panelDriversTitle.Name = "panelDriversTitle"; panelDriversTitle.Name = "panelDriversTitle";
panelDriversTitle.Size = new Size(1178, 44); panelDriversTitle.Size = new Size(628, 22);
panelDriversTitle.TabIndex = 5; panelDriversTitle.TabIndex = 5;
// //
// labelDrivers // labelDrivers
// //
labelDrivers.AutoSize = true; labelDrivers.AutoSize = true;
labelDrivers.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelDrivers.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelDrivers.Location = new Point(67, 7); labelDrivers.Location = new Point(34, 4);
labelDrivers.Margin = new Padding(2, 0, 2, 0);
labelDrivers.Name = "labelDrivers"; labelDrivers.Name = "labelDrivers";
labelDrivers.Size = new Size(254, 32); labelDrivers.Size = new Size(126, 15);
labelDrivers.TabIndex = 1; labelDrivers.TabIndex = 1;
labelDrivers.Text = "Drivers and Software"; labelDrivers.Text = "Drivers and Software";
// //
@@ -153,22 +162,24 @@
// //
pictureDrivers.BackgroundImage = (Image)resources.GetObject("pictureDrivers.BackgroundImage"); pictureDrivers.BackgroundImage = (Image)resources.GetObject("pictureDrivers.BackgroundImage");
pictureDrivers.BackgroundImageLayout = ImageLayout.Zoom; pictureDrivers.BackgroundImageLayout = ImageLayout.Zoom;
pictureDrivers.Location = new Point(29, 8); pictureDrivers.Location = new Point(14, 4);
pictureDrivers.Margin = new Padding(2);
pictureDrivers.Name = "pictureDrivers"; pictureDrivers.Name = "pictureDrivers";
pictureDrivers.Size = new Size(32, 32); pictureDrivers.Size = new Size(16, 16);
pictureDrivers.TabIndex = 2; pictureDrivers.TabIndex = 2;
pictureDrivers.TabStop = false; pictureDrivers.TabStop = false;
// //
// Updates // Updates
// //
AutoScaleDimensions = new SizeF(192F, 192F); AutoScaleDimensions = new SizeF(96F, 96F);
AutoScaleMode = AutoScaleMode.Dpi; AutoScaleMode = AutoScaleMode.Dpi;
AutoScroll = true; AutoScroll = true;
ClientSize = new Size(1178, 690); ClientSize = new Size(628, 345);
Controls.Add(panelDrivers); Controls.Add(panelDrivers);
Controls.Add(panelDriversTitle); Controls.Add(panelDriversTitle);
Controls.Add(panelBios); Controls.Add(panelBios);
Controls.Add(panelBiosTitle); Controls.Add(panelBiosTitle);
Margin = new Padding(2);
MinimizeBox = false; MinimizeBox = false;
Name = "Updates"; Name = "Updates";
ShowIcon = false; ShowIcon = false;

View File

@@ -1,9 +1,7 @@
using CustomControls; using CustomControls;
using NAudio.CoreAudioApi;
using System.Diagnostics; using System.Diagnostics;
using System.Management; using System.Management;
using System.Text.Json; using System.Text.Json;
using System.Xml.Linq;
namespace GHelper namespace GHelper
{ {
@@ -151,7 +149,7 @@ namespace GHelper
Process.Start(new ProcessStartInfo(downloadUrl) { UseShellExecute = true }); Process.Start(new ProcessStartInfo(downloadUrl) { UseShellExecute = true });
}; };
table.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); table.RowStyles.Add(new RowStyle(SizeType.AutoSize));
table.Controls.Add(new Label { Text = categoryName, Anchor = AnchorStyles.Left, Dock = DockStyle.Fill, Padding = new Padding(5, 5, 5, 5) }, 0, table.RowCount); table.Controls.Add(new Label { Text = categoryName, Anchor = AnchorStyles.Left, Dock = DockStyle.Fill, Padding = new Padding(5, 5, 5, 5) }, 0, table.RowCount);
table.Controls.Add(new Label { Text = title, Anchor = AnchorStyles.Left, Dock = DockStyle.Fill, Padding = new Padding(5, 5, 5, 5) }, 1, table.RowCount); table.Controls.Add(new Label { Text = title, Anchor = AnchorStyles.Left, Dock = DockStyle.Fill, Padding = new Padding(5, 5, 5, 5) }, 1, table.RowCount);
table.Controls.Add(versionLabel, 2, table.RowCount); table.Controls.Add(versionLabel, 2, table.RowCount);

View File

@@ -121,7 +121,7 @@
<data name="pictureBios.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="pictureBios.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DwAACw8BkvkDpQAAAWlJREFUaEPtmN1Kw0AQhVOkoo8q7ZUiguid9ULwZaS+g3jtnT6FCv4g2DOhA23I DAAACwwBP0AiyAAAAWlJREFUaEPtmN1Kw0AQhVOkoo8q7ZUiguid9ULwZaS+g3jtnT6FCv4g2DOhA23I
LrvHzKTCfPBRkuFsT9JCyDZBEASBB7fwE960R9tcwze4aI+2sZhRfMHf9WeXDygz+exiMaOQxdQu3jOK LrvHzKTCfPBRkuFsT9JCyDZBEASBB7fwE960R9tcwze4aI+2sZhRfMHf9WeXDygz+exiMaOQxdQu3jOK
3ILes2ImcAYf4eaC3s7hFFaxB+9g34JjeA/3YTHHsG+hMT2BxbxADZ7C6p9wAA7gOdQeT7CYH6jBqp9u 3ILes2ImcAYf4eaC3s7hFFaxB+9g34JjeA/3YTHHsG+hMT2BxbxADZ7C6p9wAA7gOdQeT7CYH6jBqp9u
YOS7tce3nChFQ+LYUF1SIXlCvsPBnpAFpLpkSYXk8S7nXtsjH1JdsqRCcuflIq7aIx9SXbJQISOoLlTI YOS7tce3nChFQ+LYUF1SIXlCvsPBnpAFpLpkSYXk8S7nXtsjH1JdsqRCcuflIq7aIx9SXbJQISOoLlTI