UI tweaks

This commit is contained in:
Serge
2023-05-30 14:55:50 +02:00
parent 9255a8554d
commit 52c2987c88
5 changed files with 185 additions and 95 deletions

View File

@@ -170,8 +170,8 @@ public class AsusACPI
data[0] = BitConverter.GetBytes(eventHandle.ToInt32())[0]; data[0] = BitConverter.GetBytes(eventHandle.ToInt32())[0];
data[1] = BitConverter.GetBytes(eventHandle.ToInt32())[1]; data[1] = BitConverter.GetBytes(eventHandle.ToInt32())[1];
result = Control(0x222400, data, outBuffer); Control(0x222400, data, outBuffer);
Logger.WriteLine("ACPI " + result + ":" + BitConverter.ToString(data) + "|" + BitConverter.ToString(outBuffer)); Logger.WriteLine("ACPI :" + BitConverter.ToString(data) + "|" + BitConverter.ToString(outBuffer));
while (true) while (true)
{ {
@@ -202,10 +202,11 @@ public class AsusACPI
} }
public bool Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer) public void Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer)
{ {
uint lpBytesReturned = 0; uint lpBytesReturned = 0;
return DeviceIoControl( DeviceIoControl(
handle, handle,
dwIoControlCode, dwIoControlCode,
lpInBuffer, lpInBuffer,

View File

@@ -124,6 +124,10 @@ namespace GHelper
_modes.Remove(3); _modes.Remove(3);
} }
if (AppConfig.ContainsModel("G513")) {
return _modes;
}
if (AppConfig.ContainsModel("Strix") || AppConfig.ContainsModel("Scar")) if (AppConfig.ContainsModel("Strix") || AppConfig.ContainsModel("Scar"))
{ {
return _modesStrix; return _modesStrix;

151
app/Settings.Designer.cs generated
View File

@@ -66,9 +66,9 @@ namespace GHelper
tableGPU = new TableLayoutPanel(); tableGPU = new TableLayoutPanel();
buttonEco = new RButton(); buttonEco = new RButton();
buttonStandard = new RButton(); buttonStandard = new RButton();
buttonXGM = new RButton();
buttonOptimized = new RButton(); buttonOptimized = new RButton();
buttonUltimate = new RButton(); buttonUltimate = new RButton();
buttonXGM = new RButton();
panelScreen = new Panel(); panelScreen = new Panel();
labelMidFan = new Label(); labelMidFan = new Label();
labelTipScreen = new Label(); labelTipScreen = new Label();
@@ -81,12 +81,12 @@ namespace GHelper
labelSreen = new Label(); labelSreen = new Label();
panelKeyboard = new Panel(); panelKeyboard = new Panel();
tableLayoutKeyboard = new TableLayoutPanel(); tableLayoutKeyboard = new TableLayoutPanel();
comboKeyboard = new RComboBox(); buttonKeyboard = new RButton();
panelColor = new Panel(); panelColor = new Panel();
pictureColor2 = new PictureBox(); pictureColor2 = new PictureBox();
pictureColor = new PictureBox(); pictureColor = new PictureBox();
buttonKeyboardColor = new RButton(); buttonKeyboardColor = new RButton();
buttonKeyboard = new RButton(); comboKeyboard = new RComboBox();
pictureKeyboard = new PictureBox(); pictureKeyboard = new PictureBox();
labelKeyboard = new Label(); labelKeyboard = new Label();
panelMatrix.SuspendLayout(); panelMatrix.SuspendLayout();
@@ -121,7 +121,7 @@ namespace GHelper
panelMatrix.Controls.Add(pictureMatrix); panelMatrix.Controls.Add(pictureMatrix);
panelMatrix.Controls.Add(labelMatrix); panelMatrix.Controls.Add(labelMatrix);
panelMatrix.Dock = DockStyle.Top; panelMatrix.Dock = DockStyle.Top;
panelMatrix.Location = new Point(10, 758); panelMatrix.Location = new Point(10, 795);
panelMatrix.Margin = new Padding(8); panelMatrix.Margin = new Padding(8);
panelMatrix.Name = "panelMatrix"; panelMatrix.Name = "panelMatrix";
panelMatrix.Padding = new Padding(0, 0, 0, 12); panelMatrix.Padding = new Padding(0, 0, 0, 12);
@@ -158,7 +158,7 @@ namespace GHelper
tableLayoutMatrix.Name = "tableLayoutMatrix"; tableLayoutMatrix.Name = "tableLayoutMatrix";
tableLayoutMatrix.RowCount = 1; tableLayoutMatrix.RowCount = 1;
tableLayoutMatrix.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutMatrix.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
tableLayoutMatrix.Size = new Size(771, 60); tableLayoutMatrix.Size = new Size(771, 59);
tableLayoutMatrix.TabIndex = 43; tableLayoutMatrix.TabIndex = 43;
// //
// comboMatrix // comboMatrix
@@ -202,7 +202,7 @@ namespace GHelper
buttonMatrix.Dock = DockStyle.Top; buttonMatrix.Dock = DockStyle.Top;
buttonMatrix.FlatAppearance.BorderSize = 0; buttonMatrix.FlatAppearance.BorderSize = 0;
buttonMatrix.FlatStyle = FlatStyle.Flat; buttonMatrix.FlatStyle = FlatStyle.Flat;
buttonMatrix.Location = new Point(518, 8); buttonMatrix.Location = new Point(518, 7);
buttonMatrix.Margin = new Padding(4, 7, 4, 7); buttonMatrix.Margin = new Padding(4, 7, 4, 7);
buttonMatrix.Name = "buttonMatrix"; buttonMatrix.Name = "buttonMatrix";
buttonMatrix.Secondary = true; buttonMatrix.Secondary = true;
@@ -231,7 +231,7 @@ namespace GHelper
labelMatrix.Name = "labelMatrix"; labelMatrix.Name = "labelMatrix";
labelMatrix.Size = new Size(170, 32); labelMatrix.Size = new Size(170, 32);
labelMatrix.TabIndex = 38; labelMatrix.TabIndex = 38;
labelMatrix.Text = Properties.Strings.AnimeMatrix; labelMatrix.Text = "Anime Matrix";
// //
// panelBattery // panelBattery
// //
@@ -244,7 +244,7 @@ namespace GHelper
panelBattery.Controls.Add(pictureBattery); panelBattery.Controls.Add(pictureBattery);
panelBattery.Controls.Add(labelBatteryTitle); panelBattery.Controls.Add(labelBatteryTitle);
panelBattery.Dock = DockStyle.Top; panelBattery.Dock = DockStyle.Top;
panelBattery.Location = new Point(10, 926); panelBattery.Location = new Point(10, 963);
panelBattery.Margin = new Padding(8); panelBattery.Margin = new Padding(8);
panelBattery.Name = "panelBattery"; panelBattery.Name = "panelBattery";
panelBattery.Padding = new Padding(0, 0, 0, 12); panelBattery.Padding = new Padding(0, 0, 0, 12);
@@ -276,7 +276,7 @@ namespace GHelper
// //
// labelVersion // labelVersion
// //
labelVersion.AutoSize = false; labelVersion.Cursor = Cursors.Hand;
labelVersion.Font = new Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point); labelVersion.Font = new Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point);
labelVersion.ForeColor = SystemColors.ControlDark; labelVersion.ForeColor = SystemColors.ControlDark;
labelVersion.Location = new Point(25, 119); labelVersion.Location = new Point(25, 119);
@@ -285,7 +285,6 @@ namespace GHelper
labelVersion.Size = new Size(300, 32); labelVersion.Size = new Size(300, 32);
labelVersion.TabIndex = 37; labelVersion.TabIndex = 37;
labelVersion.Text = "v.0"; labelVersion.Text = "v.0";
labelVersion.Cursor = Cursors.Hand;
// //
// labelBattery // labelBattery
// //
@@ -317,7 +316,7 @@ namespace GHelper
labelBatteryTitle.Name = "labelBatteryTitle"; labelBatteryTitle.Name = "labelBatteryTitle";
labelBatteryTitle.Size = new Size(393, 36); labelBatteryTitle.Size = new Size(393, 36);
labelBatteryTitle.TabIndex = 34; labelBatteryTitle.TabIndex = 34;
labelBatteryTitle.Text = Properties.Strings.BatteryChargeLimit; labelBatteryTitle.Text = "Battery Charge Limit";
// //
// panelFooter // panelFooter
// //
@@ -326,7 +325,7 @@ namespace GHelper
panelFooter.Controls.Add(buttonQuit); panelFooter.Controls.Add(buttonQuit);
panelFooter.Controls.Add(checkStartup); panelFooter.Controls.Add(checkStartup);
panelFooter.Dock = DockStyle.Top; panelFooter.Dock = DockStyle.Top;
panelFooter.Location = new Point(10, 1089); panelFooter.Location = new Point(10, 1126);
panelFooter.Margin = new Padding(8); panelFooter.Margin = new Padding(8);
panelFooter.Name = "panelFooter"; panelFooter.Name = "panelFooter";
panelFooter.Padding = new Padding(0, 0, 0, 10); panelFooter.Padding = new Padding(0, 0, 0, 10);
@@ -398,7 +397,7 @@ namespace GHelper
labelPerf.Name = "labelPerf"; labelPerf.Name = "labelPerf";
labelPerf.Size = new Size(234, 32); labelPerf.Size = new Size(234, 32);
labelPerf.TabIndex = 31; labelPerf.TabIndex = 31;
labelPerf.Text = Properties.Strings.PerformanceMode; labelPerf.Text = "Performance Mode";
// //
// labelCPUFan // labelCPUFan
// //
@@ -572,7 +571,7 @@ namespace GHelper
labelGPU.Name = "labelGPU"; labelGPU.Name = "labelGPU";
labelGPU.Size = new Size(136, 32); labelGPU.Size = new Size(136, 32);
labelGPU.TabIndex = 18; labelGPU.TabIndex = 18;
labelGPU.Text = Properties.Strings.GPUMode; labelGPU.Text = "GPU Mode";
// //
// labelGPUFan // labelGPUFan
// //
@@ -653,6 +652,29 @@ namespace GHelper
buttonStandard.TextImageRelation = TextImageRelation.ImageAboveText; buttonStandard.TextImageRelation = TextImageRelation.ImageAboveText;
buttonStandard.UseVisualStyleBackColor = false; buttonStandard.UseVisualStyleBackColor = false;
// //
// buttonXGM
//
buttonXGM.Activated = false;
buttonXGM.BackColor = SystemColors.ControlLightLight;
buttonXGM.BorderColor = Color.Transparent;
buttonXGM.BorderRadius = 5;
buttonXGM.Dock = DockStyle.Top;
buttonXGM.FlatAppearance.BorderSize = 0;
buttonXGM.FlatStyle = FlatStyle.Flat;
buttonXGM.ForeColor = SystemColors.ControlText;
buttonXGM.Image = Properties.Resources.icons8_video_48;
buttonXGM.ImageAlign = ContentAlignment.BottomCenter;
buttonXGM.Location = new Point(4, 132);
buttonXGM.Margin = new Padding(4);
buttonXGM.Name = "buttonXGM";
buttonXGM.Secondary = false;
buttonXGM.Size = new Size(185, 120);
buttonXGM.TabIndex = 2;
buttonXGM.Text = "XG Mobile";
buttonXGM.TextImageRelation = TextImageRelation.ImageAboveText;
buttonXGM.UseVisualStyleBackColor = false;
buttonXGM.Visible = false;
//
// buttonOptimized // buttonOptimized
// //
buttonOptimized.Activated = false; buttonOptimized.Activated = false;
@@ -696,30 +718,6 @@ namespace GHelper
buttonUltimate.Text = Properties.Strings.UltimateMode; buttonUltimate.Text = Properties.Strings.UltimateMode;
buttonUltimate.TextImageRelation = TextImageRelation.ImageAboveText; buttonUltimate.TextImageRelation = TextImageRelation.ImageAboveText;
buttonUltimate.UseVisualStyleBackColor = false; buttonUltimate.UseVisualStyleBackColor = false;
//
// buttonXGM
//
buttonXGM.Activated = false;
buttonXGM.BackColor = SystemColors.ControlLightLight;
buttonXGM.BorderColor = Color.Transparent;
buttonXGM.BorderRadius = 5;
buttonXGM.Dock = DockStyle.Top;
buttonXGM.FlatAppearance.BorderSize = 0;
buttonXGM.FlatStyle = FlatStyle.Flat;
buttonXGM.ForeColor = SystemColors.ControlText;
buttonXGM.Image = Properties.Resources.icons8_video_48;
buttonXGM.ImageAlign = ContentAlignment.BottomCenter;
buttonXGM.Location = new Point(390, 4);
buttonXGM.Margin = new Padding(4);
buttonXGM.Name = "buttonXGM";
buttonXGM.Secondary = false;
buttonXGM.Size = new Size(185, 120);
buttonXGM.TabIndex = 2;
buttonXGM.Text = "XG Mobile";
buttonXGM.TextImageRelation = TextImageRelation.ImageAboveText;
buttonXGM.UseVisualStyleBackColor = false;
buttonXGM.Visible = false;
// //
// panelScreen // panelScreen
// //
@@ -731,7 +729,7 @@ namespace GHelper
panelScreen.Controls.Add(pictureScreen); panelScreen.Controls.Add(pictureScreen);
panelScreen.Controls.Add(labelSreen); panelScreen.Controls.Add(labelSreen);
panelScreen.Dock = DockStyle.Top; panelScreen.Dock = DockStyle.Top;
panelScreen.Location = new Point(10, 447); panelScreen.Location = new Point(10, 485);
panelScreen.Margin = new Padding(8); panelScreen.Margin = new Padding(8);
panelScreen.Name = "panelScreen"; panelScreen.Name = "panelScreen";
panelScreen.Padding = new Padding(0, 0, 0, 10); panelScreen.Padding = new Padding(0, 0, 0, 10);
@@ -878,7 +876,7 @@ namespace GHelper
labelSreen.Name = "labelSreen"; labelSreen.Name = "labelSreen";
labelSreen.Size = new Size(176, 32); labelSreen.Size = new Size(176, 32);
labelSreen.TabIndex = 21; labelSreen.TabIndex = 21;
labelSreen.Text = Properties.Strings.LaptopScreen; labelSreen.Text = "Laptop Screen";
// //
// panelKeyboard // panelKeyboard
// //
@@ -888,11 +886,11 @@ namespace GHelper
panelKeyboard.Controls.Add(pictureKeyboard); panelKeyboard.Controls.Add(pictureKeyboard);
panelKeyboard.Controls.Add(labelKeyboard); panelKeyboard.Controls.Add(labelKeyboard);
panelKeyboard.Dock = DockStyle.Top; panelKeyboard.Dock = DockStyle.Top;
panelKeyboard.Location = new Point(10, 628); panelKeyboard.Location = new Point(10, 666);
panelKeyboard.Margin = new Padding(8); panelKeyboard.Margin = new Padding(8);
panelKeyboard.Name = "panelKeyboard"; panelKeyboard.Name = "panelKeyboard";
panelKeyboard.Padding = new Padding(0, 0, 0, 12); panelKeyboard.Padding = new Padding(0, 0, 0, 12);
panelKeyboard.Size = new Size(810, 130); panelKeyboard.Size = new Size(810, 129);
panelKeyboard.TabIndex = 39; panelKeyboard.TabIndex = 39;
// //
// tableLayoutKeyboard // tableLayoutKeyboard
@@ -912,25 +910,26 @@ namespace GHelper
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(771, 60); tableLayoutKeyboard.Size = new Size(771, 59);
tableLayoutKeyboard.TabIndex = 39; tableLayoutKeyboard.TabIndex = 39;
// //
// comboKeyboard // buttonKeyboard
// //
comboKeyboard.BorderColor = Color.White; buttonKeyboard.Activated = false;
comboKeyboard.ButtonColor = Color.FromArgb(255, 255, 255); buttonKeyboard.BackColor = SystemColors.ControlLight;
comboKeyboard.Dock = DockStyle.Top; buttonKeyboard.BorderColor = Color.Transparent;
comboKeyboard.FlatStyle = FlatStyle.Flat; buttonKeyboard.BorderRadius = 2;
comboKeyboard.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point); buttonKeyboard.Dock = DockStyle.Top;
comboKeyboard.FormattingEnabled = true; buttonKeyboard.FlatAppearance.BorderSize = 0;
comboKeyboard.ItemHeight = 32; buttonKeyboard.FlatStyle = FlatStyle.Flat;
comboKeyboard.Items.AddRange(new object[] { "Static", "Breathe", "Rainbow", "Strobe" }); buttonKeyboard.Location = new Point(518, 7);
comboKeyboard.Location = new Point(4, 10); buttonKeyboard.Margin = new Padding(4, 7, 4, 7);
comboKeyboard.Margin = new Padding(4, 10, 4, 8); buttonKeyboard.Name = "buttonKeyboard";
comboKeyboard.Name = "comboKeyboard"; buttonKeyboard.Secondary = true;
comboKeyboard.Size = new Size(249, 44); buttonKeyboard.Size = new Size(249, 45);
comboKeyboard.TabIndex = 35; buttonKeyboard.TabIndex = 37;
comboKeyboard.TabStop = false; buttonKeyboard.Text = Properties.Strings.Extra;
buttonKeyboard.UseVisualStyleBackColor = false;
// //
// panelColor // panelColor
// //
@@ -939,7 +938,7 @@ namespace GHelper
panelColor.Controls.Add(pictureColor); panelColor.Controls.Add(pictureColor);
panelColor.Controls.Add(buttonKeyboardColor); panelColor.Controls.Add(buttonKeyboardColor);
panelColor.Dock = DockStyle.Fill; panelColor.Dock = DockStyle.Fill;
panelColor.Location = new Point(261, 8); panelColor.Location = new Point(261, 7);
panelColor.Margin = new Padding(4, 7, 4, 7); panelColor.Margin = new Padding(4, 7, 4, 7);
panelColor.Name = "panelColor"; panelColor.Name = "panelColor";
panelColor.Size = new Size(249, 45); panelColor.Size = new Size(249, 45);
@@ -983,23 +982,22 @@ namespace GHelper
buttonKeyboardColor.Text = Properties.Strings.Color; buttonKeyboardColor.Text = Properties.Strings.Color;
buttonKeyboardColor.UseVisualStyleBackColor = false; buttonKeyboardColor.UseVisualStyleBackColor = false;
// //
// buttonKeyboard // comboKeyboard
// //
buttonKeyboard.Activated = false; comboKeyboard.BorderColor = Color.White;
buttonKeyboard.BackColor = SystemColors.ControlLight; comboKeyboard.ButtonColor = Color.FromArgb(255, 255, 255);
buttonKeyboard.BorderColor = Color.Transparent; comboKeyboard.Dock = DockStyle.Top;
buttonKeyboard.BorderRadius = 2; comboKeyboard.FlatStyle = FlatStyle.Flat;
buttonKeyboard.Dock = DockStyle.Top; comboKeyboard.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
buttonKeyboard.FlatAppearance.BorderSize = 0; comboKeyboard.FormattingEnabled = true;
buttonKeyboard.FlatStyle = FlatStyle.Flat; comboKeyboard.ItemHeight = 32;
buttonKeyboard.Location = new Point(518, 8); comboKeyboard.Items.AddRange(new object[] { "Static", "Breathe", "Rainbow", "Strobe" });
buttonKeyboard.Margin = new Padding(4, 7, 4, 7); comboKeyboard.Location = new Point(4, 10);
buttonKeyboard.Name = "buttonKeyboard"; comboKeyboard.Margin = new Padding(4, 10, 4, 8);
buttonKeyboard.Secondary = true; comboKeyboard.Name = "comboKeyboard";
buttonKeyboard.Size = new Size(249, 45); comboKeyboard.Size = new Size(249, 40);
buttonKeyboard.TabIndex = 37; comboKeyboard.TabIndex = 35;
buttonKeyboard.Text = Properties.Strings.Extra; comboKeyboard.TabStop = false;
buttonKeyboard.UseVisualStyleBackColor = false;
// //
// pictureKeyboard // pictureKeyboard
// //
@@ -1021,7 +1019,7 @@ namespace GHelper
labelKeyboard.Name = "labelKeyboard"; labelKeyboard.Name = "labelKeyboard";
labelKeyboard.Size = new Size(210, 32); labelKeyboard.Size = new Size(210, 32);
labelKeyboard.TabIndex = 32; labelKeyboard.TabIndex = 32;
labelKeyboard.Text = Properties.Strings.LaptopKeyboard; labelKeyboard.Text = "Laptop Keyboard";
// //
// SettingsForm // SettingsForm
// //
@@ -1053,7 +1051,6 @@ namespace GHelper
tableLayoutMatrix.ResumeLayout(false); tableLayoutMatrix.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)pictureMatrix).EndInit(); ((System.ComponentModel.ISupportInitialize)pictureMatrix).EndInit();
panelBattery.ResumeLayout(false); panelBattery.ResumeLayout(false);
panelBattery.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureBattery).EndInit(); ((System.ComponentModel.ISupportInitialize)pictureBattery).EndInit();
panelFooter.ResumeLayout(false); panelFooter.ResumeLayout(false);
panelFooter.PerformLayout(); panelFooter.PerformLayout();

View File

@@ -41,6 +41,36 @@ namespace GHelper
InitializeComponent(); InitializeComponent();
InitTheme(true); InitTheme(true);
buttonSilent.Text = Properties.Strings.Silent;
buttonBalanced.Text = Properties.Strings.Balanced;
buttonTurbo.Text = Properties.Strings.Turbo;
buttonFans.Text = Properties.Strings.FansPower;
buttonEco.Text = Properties.Strings.EcoMode;
buttonUltimate.Text = Properties.Strings.UltimateMode;
buttonStandard.Text = Properties.Strings.StandardMode;
buttonOptimized.Text = Properties.Strings.Optimized;
buttonScreenAuto.Text = Properties.Strings.AutoMode;
buttonMiniled.Text = Properties.Strings.ToggleMiniled;
buttonKeyboardColor.Text = Properties.Strings.Color;
buttonKeyboard.Text = Properties.Strings.Extra;
labelPerf.Text = Properties.Strings.PerformanceMode;
labelGPU.Text = Properties.Strings.GPUMode;
labelSreen.Text = Properties.Strings.LaptopScreen;
labelKeyboard.Text = Properties.Strings.LaptopKeyboard;
labelMatrix.Text = Properties.Strings.AnimeMatrix;
labelBatteryTitle.Text = Properties.Strings.BatteryChargeLimit;
checkMatrix.Text = Properties.Strings.TurnOffOnBattery;
checkStartup.Text = Properties.Strings.RunOnStartup;
buttonMatrix.Text = Properties.Strings.PictureGif;
buttonQuit.Text = Properties.Strings.Quit;
FormClosing += SettingsForm_FormClosing; FormClosing += SettingsForm_FormClosing;
buttonSilent.BorderColor = colorEco; buttonSilent.BorderColor = colorEco;
@@ -58,7 +88,6 @@ namespace GHelper
buttonScreenAuto.BorderColor = SystemColors.ActiveBorder; buttonScreenAuto.BorderColor = SystemColors.ActiveBorder;
buttonMiniled.BorderColor = colorTurbo; buttonMiniled.BorderColor = colorTurbo;
buttonOptimized.Click += ButtonOptimized_Click;
buttonSilent.Click += ButtonSilent_Click; buttonSilent.Click += ButtonSilent_Click;
buttonBalanced.Click += ButtonBalanced_Click; buttonBalanced.Click += ButtonBalanced_Click;
buttonTurbo.Click += ButtonTurbo_Click; buttonTurbo.Click += ButtonTurbo_Click;
@@ -66,6 +95,7 @@ namespace GHelper
buttonEco.Click += ButtonEco_Click; buttonEco.Click += ButtonEco_Click;
buttonStandard.Click += ButtonStandard_Click; buttonStandard.Click += ButtonStandard_Click;
buttonUltimate.Click += ButtonUltimate_Click; buttonUltimate.Click += ButtonUltimate_Click;
buttonOptimized.Click += ButtonOptimized_Click;
VisibleChanged += SettingsForm_VisibleChanged; VisibleChanged += SettingsForm_VisibleChanged;
@@ -922,21 +952,21 @@ namespace GHelper
HardwareControl.ReadSensors(); HardwareControl.ReadSensors();
if (HardwareControl.cpuTemp > 0) if (HardwareControl.cpuTemp > 0)
cpuTemp = ": " + Math.Round((decimal)HardwareControl.cpuTemp).ToString() + "°C "; cpuTemp = ": " + Math.Round((decimal)HardwareControl.cpuTemp).ToString() + "°C";
if (HardwareControl.batteryDischarge > 0) if (HardwareControl.batteryDischarge > 0)
battery = Properties.Strings.Discharging + ": " + Math.Round((decimal)HardwareControl.batteryDischarge, 1).ToString() + "W"; battery = Properties.Strings.Discharging + ": " + Math.Round((decimal)HardwareControl.batteryDischarge, 1).ToString() + "W";
if (HardwareControl.gpuTemp > 0) if (HardwareControl.gpuTemp > 0)
{ {
gpuTemp = $": {HardwareControl.gpuTemp}°C "; gpuTemp = $": {HardwareControl.gpuTemp}°C";
} }
Program.settingsForm.BeginInvoke(delegate Program.settingsForm.BeginInvoke(delegate
{ {
labelCPUFan.Text = "CPU" + cpuTemp + HardwareControl.cpuFan; labelCPUFan.Text = "CPU" + cpuTemp + " " + HardwareControl.cpuFan;
labelGPUFan.Text = "GPU" + gpuTemp + HardwareControl.gpuFan; labelGPUFan.Text = "GPU" + gpuTemp + " " + HardwareControl.gpuFan;
if (HardwareControl.midFan is not null) if (HardwareControl.midFan is not null)
labelMidFan.Text = "Mid" + HardwareControl.midFan; labelMidFan.Text = "Mid" + HardwareControl.midFan;
@@ -1505,7 +1535,7 @@ namespace GHelper
protected static void KillGPUApps() protected static void KillGPUApps()
{ {
string[] tokill = { "EADesktop", "RadeonSoftware", "epicgameslauncher" }; string[] tokill = { "EADesktop", "RadeonSoftware", "epicgameslauncher", "nvdisplay.container", "nvcontainer", "nvcplui" };
foreach (string kill in tokill) foreach (string kill in tokill)
foreach (var process in Process.GetProcessesByName(kill)) process.Kill(); foreach (var process in Process.GetProcessesByName(kill)) process.Kill();
@@ -1531,19 +1561,17 @@ namespace GHelper
Task.Run(async () => Task.Run(async () =>
{ {
int status; int status = 1;
if (eco == 1) KillGPUApps(); if (eco == 1) KillGPUApps();
//if (eco == 1) status = 0; else Logger.WriteLine($"Running eco command {eco}");
status = Program.acpi.SetGPUEco(eco); status = Program.acpi.SetGPUEco(eco);
if (status == 0 && eco == 1 && hardWay) if (status == 0 && eco == 1 && hardWay) RestartGPU();
{
RestartGPU();
}
await Task.Delay(TimeSpan.FromMilliseconds(500)); await Task.Delay(TimeSpan.FromMilliseconds(100));
Program.settingsForm.BeginInvoke(delegate Program.settingsForm.BeginInvoke(delegate
{ {
InitGPUMode(); InitGPUMode();

View File

@@ -1,4 +1,64 @@
<root> <?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">