Compare commits

...

30 Commits

Author SHA1 Message Date
Serge
8280ce1d1c Aura tweaks 2024-01-09 10:55:55 +01:00
Serge
ea73de4414 Aura tweaks for G513QM https://github.com/seerge/g-helper/issues/1868 2024-01-08 13:49:51 +01:00
Serge
adcba8d35e Keybindings tweak for FA506IV https://github.com/seerge/g-helper/issues/1869 2024-01-08 10:27:03 +01:00
Serge
baf52720bb Fix to prevent config corruption 2024-01-07 21:38:53 +01:00
Serge
8a2eec7823 Config fix 2024-01-07 18:27:43 +01:00
Serge
2be3b831ef UI tweaks https://github.com/seerge/g-helper/issues/533 2024-01-06 19:51:18 +01:00
Serge
3785454200 Reduced Ambient mode refresh rate for M16 2024-01-06 13:38:39 +01:00
Serge
48c6f4f659 Merge branch 'main' of https://github.com/seerge/g-helper 2024-01-05 11:38:23 +01:00
Serge
605c699651 UI error on wrong mouse DPI https://github.com/seerge/g-helper/issues/1850#issuecomment-1878456736 2024-01-05 11:38:21 +01:00
Serge
096366de4e New translations strings.resx (Chinese Simplified) (#1849) 2024-01-05 11:34:46 +01:00
Serge
797381463d Update README.md 2024-01-04 18:30:00 +01:00
IceStormNG
69ec75ff79 Support for Gladius II and Gladius II Origin (#1848) 2024-01-04 18:15:52 +01:00
Serge
dca954a244 Merge branch 'main' of https://github.com/seerge/g-helper 2024-01-04 11:31:57 +01:00
Serge
440632c209 Version Bump 2024-01-04 11:27:30 +01:00
Serge
274c2ef706 New translations strings.resx (Polish) (#1840) 2024-01-03 16:24:54 +01:00
Serge
acb7a45139 Enable GPU on shutdown for all Nvidia devices https://github.com/seerge/g-helper/issues/1841 2024-01-03 15:54:10 +01:00
Serge
9d5c70b4c3 Merge branch 'main' of https://github.com/seerge/g-helper 2024-01-03 13:01:32 +01:00
Serge
cc682412cc HDR check for miniled toggle https://github.com/seerge/g-helper/issues/1822#issuecomment-1874770630 2024-01-03 13:01:30 +01:00
Serge
ee89a2308b New translations strings.resx (Spanish) (#1837) 2024-01-02 22:12:48 +01:00
Serge
1578c7a18e Version Bump 2024-01-02 17:42:32 +01:00
Serge
b50f4f11a4 UI Tweaks 2024-01-02 17:29:59 +01:00
Serge
ad5b3e33c4 UI Tweaks 2024-01-02 17:19:01 +01:00
Serge
5de44067bc Dynamic Boost fallback https://github.com/seerge/g-helper/issues/1834 2024-01-01 22:13:42 +01:00
Serge
82f76b8d80 Accessibility improvements https://github.com/seerge/g-helper/issues/1830 2024-01-01 20:05:44 +01:00
Serge
0823e8efa2 Merge branch 'main' of https://github.com/seerge/g-helper 2024-01-01 16:26:19 +01:00
Serge
7bd0d3594a UI tweaks 2024-01-01 16:26:17 +01:00
Serge
573b56f6b6 New Crowdin updates (#1824)
* New translations strings.resx (French)

* New translations strings.resx (Turkish)

* New translations strings.resx (Romanian)

* New translations strings.resx (Spanish)

* New translations strings.resx (German)

* New translations strings.resx (Hungarian)

* New translations strings.resx (Italian)

* New translations strings.resx (Korean)

* New translations strings.resx (Lithuanian)

* New translations strings.resx (Polish)

* New translations strings.resx (Portuguese)

* New translations strings.resx (Ukrainian)

* New translations strings.resx (Chinese Simplified)

* New translations strings.resx (Chinese Traditional)

* New translations strings.resx (Vietnamese)

* New translations strings.resx (Portuguese, Brazilian)

* New translations strings.resx (Indonesian)
2024-01-01 11:16:25 +01:00
Serge
aabead161a Multizone toggle toast https://github.com/seerge/g-helper/issues/1822 2023-12-31 15:35:00 +01:00
Serge
5602d385f6 Translations for accessible labels https://github.com/seerge/g-helper/issues/1823 2023-12-31 15:28:22 +01:00
Serge
537123acda Ultimate mode for G834 https://github.com/seerge/g-helper/discussions/1816 2023-12-30 11:18:17 +01:00
41 changed files with 966 additions and 449 deletions

View File

@@ -1,5 +1,4 @@
using GHelper.Mode; using GHelper.Mode;
using System.Diagnostics;
using System.Management; using System.Management;
using System.Text.Json; using System.Text.Json;
@@ -13,6 +12,7 @@ public static class AppConfig
private static string? _bios; private static string? _bios;
private static Dictionary<string, object> config = new Dictionary<string, object>(); private static Dictionary<string, object> config = new Dictionary<string, object>();
private static System.Timers.Timer timer = new System.Timers.Timer(1000);
static AppConfig() static AppConfig()
{ {
@@ -24,7 +24,8 @@ public static class AppConfig
if (File.Exists(startupPath + configName)) if (File.Exists(startupPath + configName))
{ {
configFile = startupPath + configName; configFile = startupPath + configName;
} else }
else
{ {
configFile = appPath + configName; configFile = appPath + configName;
} }
@@ -51,8 +52,39 @@ public static class AppConfig
Init(); Init();
} }
timer.Elapsed += Timer_Elapsed;
} }
private static void Timer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
{
timer.Stop();
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
var backup = configFile + ".bak";
try
{
File.WriteAllText(backup, jsonString);
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
return;
}
Thread.Sleep(500);
if (File.ReadAllText(backup).Contains("}"))
{
File.Copy(backup, configFile, true);
}
else
{
Logger.WriteLine("Error writing config");
}
}
public static string GetModel() public static string GetModel()
{ {
@@ -156,15 +188,7 @@ public static class AppConfig
private static void Write() private static void Write()
{ {
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true }); timer.Start();
try
{
File.WriteAllText(configFile, jsonString);
}
catch (Exception e)
{
Debug.Write(e.ToString());
}
} }
public static void Set(string name, int value) public static void Set(string name, int value)
@@ -328,7 +352,7 @@ public static class AppConfig
// Devices with bugged bios command to change brightness // Devices with bugged bios command to change brightness
public static bool SwappedBrightness() public static bool SwappedBrightness()
{ {
return ContainsModel("FA506IH") || ContainsModel("FA506IC") || ContainsModel("FX506LU") || ContainsModel("FX506IC") || ContainsModel("FX506LH"); return ContainsModel("FA506IH") || ContainsModel("FA506IC") || ContainsModel("FX506LU") || ContainsModel("FX506IC") || ContainsModel("FX506LH") || ContainsModel("FA506IV");
} }
@@ -345,7 +369,7 @@ public static class AppConfig
public static bool IsSingleColor() public static bool IsSingleColor()
{ {
return ContainsModel("GA401") || ContainsModel("FX517Z") || ContainsModel("FX516P") || ContainsModel("X13") || IsARCNM() || ContainsModel("GA502IU"); return ContainsModel("GA401") || ContainsModel("FX517Z") || ContainsModel("FX516P") || ContainsModel("X13") || IsARCNM() || ContainsModel("GA502IU");
} }
public static bool IsStrix() public static bool IsStrix()
@@ -355,7 +379,12 @@ public static class AppConfig
public static bool IsStrixLimitedRGB() public static bool IsStrixLimitedRGB()
{ {
return ContainsModel("G614JV") || ContainsModel("G614JZ") || ContainsModel("G512LI") || ContainsModel("G513R") || ContainsModel("G713PV") || ContainsModel("G513IE") || ContainsModel("G713RC"); return ContainsModel("G614JV") || ContainsModel("G614JZ") || ContainsModel("G512LI") || ContainsModel("G513R") || ContainsModel("G713PV") || ContainsModel("G513IE") || ContainsModel("G713RC") || ContainsModel("G513QM");
}
public static bool IsNoDirectRGB()
{
return ContainsModel("GA503");
} }
public static bool IsStrixNumpad() public static bool IsStrixNumpad()
@@ -395,7 +424,7 @@ public static class AppConfig
public static bool NoAutoUltimate() public static bool NoAutoUltimate()
{ {
return ContainsModel("G614") || ContainsModel("GU604") || ContainsModel("FX507") || ContainsModel("G513") || ContainsModel("FA617"); return ContainsModel("G614") || ContainsModel("GU604") || ContainsModel("FX507") || ContainsModel("G513") || ContainsModel("FA617") || ContainsModel("G834");
} }
@@ -419,7 +448,8 @@ public static class AppConfig
{ {
var (bios, model) = GetBiosAndModel(); var (bios, model) = GetBiosAndModel();
return (Int32.Parse(bios) < 312); return (Int32.Parse(bios) < 312);
} catch }
catch
{ {
return false; return false;
} }
@@ -435,11 +465,6 @@ public static class AppConfig
return ContainsModel("FX507") || ContainsModel("FX517") || ContainsModel("FX707"); return ContainsModel("FX507") || ContainsModel("FX517") || ContainsModel("FX707");
} }
public static bool IsGPUFixNeeded()
{
return ContainsModel("GA402X") || ContainsModel("GV302") || ContainsModel("GV301") || ContainsModel("GZ301") || ContainsModel("FX506") || ContainsModel("FA506") || ContainsModel("GU603") || ContainsModel("GU604") || ContainsModel("G614J") || ContainsModel("GA503") || ContainsModel("FX507");
}
public static bool IsGPUFix() public static bool IsGPUFix()
{ {
return Is("gpu_fix") || (ContainsModel("GA402X") && IsNotFalse("gpu_fix")); return Is("gpu_fix") || (ContainsModel("GA402X") && IsNotFalse("gpu_fix"));

View File

@@ -554,6 +554,11 @@ public class AsusACPI
return DeviceGet(PPT_CPUB0) >= 0 && DeviceGet(PPT_GPUC0) < 0; return DeviceGet(PPT_CPUB0) >= 0 && DeviceGet(PPT_GPUC0) < 0;
} }
public bool IsNVidiaGPU()
{
return (!IsAllAmdPPT() && Program.acpi.DeviceGet(GPUEco) >= 0 && !AppConfig.IsAlly());
}
public void SetAPUMem(int memory = 4) public void SetAPUMem(int memory = 4)
{ {
if (memory < 0 || memory > 8) return; if (memory < 0 || memory > 8) return;

View File

@@ -863,7 +863,14 @@ namespace GHelper
private void VisualizeCurrentDPIProfile() private void VisualizeCurrentDPIProfile()
{ {
if (mouse.DpiProfile > mouse.DpiSettings.Count())
{
Logger.WriteLine($"Wrong mouse DPI: {mouse.DpiProfile}");
return;
}
AsusMouseDPI dpi = mouse.DpiSettings[mouse.DpiProfile - 1]; AsusMouseDPI dpi = mouse.DpiSettings[mouse.DpiProfile - 1];
if (dpi is null) if (dpi is null)
{ {
return; return;

View File

@@ -57,11 +57,12 @@ namespace GHelper.Display
} }
public void ToogleMiniled() public int ToogleMiniled()
{ {
int miniled = (Program.acpi.DeviceGet(AsusACPI.ScreenMiniled) == 1) ? 0 : 1; int miniled = (Program.acpi.DeviceGet(AsusACPI.ScreenMiniled) == 1) ? 0 : 1;
AppConfig.Set("miniled", miniled); AppConfig.Set("miniled", miniled);
SetScreen(-1, -1, miniled); SetScreen(-1, -1, miniled);
return miniled;
} }
public void InitScreen() public void InitScreen()

21
app/Extra.Designer.cs generated
View File

@@ -148,7 +148,6 @@ namespace GHelper
// //
// panelServices // panelServices
// //
panelServices.AccessibleName = "Asus Services";
panelServices.AccessibleRole = AccessibleRole.Grouping; panelServices.AccessibleRole = AccessibleRole.Grouping;
panelServices.Controls.Add(pictureService); panelServices.Controls.Add(pictureService);
panelServices.Controls.Add(labelServices); panelServices.Controls.Add(labelServices);
@@ -245,7 +244,6 @@ namespace GHelper
// //
// panelBindings // panelBindings
// //
panelBindings.AccessibleName = "Key Bindings";
panelBindings.AutoSize = true; panelBindings.AutoSize = true;
panelBindings.AutoSizeMode = AutoSizeMode.GrowAndShrink; panelBindings.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelBindings.Controls.Add(tableBindings); panelBindings.Controls.Add(tableBindings);
@@ -259,7 +257,6 @@ namespace GHelper
// //
// tableBindings // tableBindings
// //
tableBindings.AccessibleName = "Keyboard Bindings";
tableBindings.AccessibleRole = AccessibleRole.Table; tableBindings.AccessibleRole = AccessibleRole.Table;
tableBindings.AutoSize = true; tableBindings.AutoSize = true;
tableBindings.AutoSizeMode = AutoSizeMode.GrowAndShrink; tableBindings.AutoSizeMode = AutoSizeMode.GrowAndShrink;
@@ -318,7 +315,6 @@ namespace GHelper
// //
// comboFNE // comboFNE
// //
comboFNE.AccessibleName = "Fn+Numpad Action";
comboFNE.BorderColor = Color.White; comboFNE.BorderColor = Color.White;
comboFNE.ButtonColor = Color.FromArgb(255, 255, 255); comboFNE.ButtonColor = Color.FromArgb(255, 255, 255);
comboFNE.Dock = DockStyle.Top; comboFNE.Dock = DockStyle.Top;
@@ -375,7 +371,6 @@ namespace GHelper
// //
// comboM1 // comboM1
// //
comboM1.AccessibleName = "M1 Action";
comboM1.BorderColor = Color.White; comboM1.BorderColor = Color.White;
comboM1.ButtonColor = Color.FromArgb(255, 255, 255); comboM1.ButtonColor = Color.FromArgb(255, 255, 255);
comboM1.Dock = DockStyle.Top; comboM1.Dock = DockStyle.Top;
@@ -400,7 +395,6 @@ namespace GHelper
// //
// comboM4 // comboM4
// //
comboM4.AccessibleName = "M4 Action";
comboM4.BorderColor = Color.White; comboM4.BorderColor = Color.White;
comboM4.ButtonColor = Color.FromArgb(255, 255, 255); comboM4.ButtonColor = Color.FromArgb(255, 255, 255);
comboM4.Dock = DockStyle.Top; comboM4.Dock = DockStyle.Top;
@@ -414,7 +408,6 @@ namespace GHelper
// //
// comboM3 // comboM3
// //
comboM3.AccessibleName = "M3 Action";
comboM3.BorderColor = Color.White; comboM3.BorderColor = Color.White;
comboM3.ButtonColor = Color.FromArgb(255, 255, 255); comboM3.ButtonColor = Color.FromArgb(255, 255, 255);
comboM3.Dock = DockStyle.Top; comboM3.Dock = DockStyle.Top;
@@ -483,7 +476,6 @@ namespace GHelper
// //
// comboM2 // comboM2
// //
comboM2.AccessibleName = "M2 Action";
comboM2.BorderColor = Color.White; comboM2.BorderColor = Color.White;
comboM2.ButtonColor = Color.FromArgb(255, 255, 255); comboM2.ButtonColor = Color.FromArgb(255, 255, 255);
comboM2.Dock = DockStyle.Top; comboM2.Dock = DockStyle.Top;
@@ -508,7 +500,6 @@ namespace GHelper
// //
// comboFNF4 // comboFNF4
// //
comboFNF4.AccessibleName = "Fn+F4 Action";
comboFNF4.BorderColor = Color.White; comboFNF4.BorderColor = Color.White;
comboFNF4.ButtonColor = Color.FromArgb(255, 255, 255); comboFNF4.ButtonColor = Color.FromArgb(255, 255, 255);
comboFNF4.Dock = DockStyle.Top; comboFNF4.Dock = DockStyle.Top;
@@ -532,7 +523,6 @@ namespace GHelper
// //
// comboFNC // comboFNC
// //
comboFNC.AccessibleName = "Fn+C Action";
comboFNC.BorderColor = Color.White; comboFNC.BorderColor = Color.White;
comboFNC.ButtonColor = Color.FromArgb(255, 255, 255); comboFNC.ButtonColor = Color.FromArgb(255, 255, 255);
comboFNC.Dock = DockStyle.Top; comboFNC.Dock = DockStyle.Top;
@@ -653,7 +643,6 @@ namespace GHelper
// //
// numericBacklightPluggedTime // numericBacklightPluggedTime
// //
numericBacklightPluggedTime.AccessibleName = "Backlight Timeout when plugged";
numericBacklightPluggedTime.Anchor = AnchorStyles.Top | AnchorStyles.Right; numericBacklightPluggedTime.Anchor = AnchorStyles.Top | AnchorStyles.Right;
numericBacklightPluggedTime.Location = new Point(670, 63); numericBacklightPluggedTime.Location = new Point(670, 63);
numericBacklightPluggedTime.Margin = new Padding(4, 3, 4, 3); numericBacklightPluggedTime.Margin = new Padding(4, 3, 4, 3);
@@ -664,7 +653,6 @@ namespace GHelper
// //
// numericBacklightTime // numericBacklightTime
// //
numericBacklightTime.AccessibleName = "Backlight Timeout when on battery";
numericBacklightTime.Anchor = AnchorStyles.Top | AnchorStyles.Right; numericBacklightTime.Anchor = AnchorStyles.Top | AnchorStyles.Right;
numericBacklightTime.Location = new Point(822, 63); numericBacklightTime.Location = new Point(822, 63);
numericBacklightTime.Margin = new Padding(4, 3, 4, 3); numericBacklightTime.Margin = new Padding(4, 3, 4, 3);
@@ -693,7 +681,6 @@ namespace GHelper
// //
// comboKeyboardSpeed // comboKeyboardSpeed
// //
comboKeyboardSpeed.AccessibleName = "Keyboard Animation Speed";
comboKeyboardSpeed.Anchor = AnchorStyles.Top | AnchorStyles.Right; comboKeyboardSpeed.Anchor = AnchorStyles.Top | AnchorStyles.Right;
comboKeyboardSpeed.BorderColor = Color.White; comboKeyboardSpeed.BorderColor = Color.White;
comboKeyboardSpeed.ButtonColor = SystemColors.ControlLight; comboKeyboardSpeed.ButtonColor = SystemColors.ControlLight;
@@ -786,7 +773,6 @@ namespace GHelper
// //
// checkAwake // checkAwake
// //
checkAwake.AccessibleName = "Awake Backlight";
checkAwake.Dock = DockStyle.Fill; checkAwake.Dock = DockStyle.Fill;
checkAwake.Location = new Point(4, 45); checkAwake.Location = new Point(4, 45);
checkAwake.Margin = new Padding(4, 0, 4, 0); checkAwake.Margin = new Padding(4, 0, 4, 0);
@@ -799,7 +785,6 @@ namespace GHelper
// //
// checkBoot // checkBoot
// //
checkBoot.AccessibleName = "Boot Backlight";
checkBoot.Dock = DockStyle.Fill; checkBoot.Dock = DockStyle.Fill;
checkBoot.Location = new Point(4, 88); checkBoot.Location = new Point(4, 88);
checkBoot.Margin = new Padding(4, 0, 4, 0); checkBoot.Margin = new Padding(4, 0, 4, 0);
@@ -812,7 +797,6 @@ namespace GHelper
// //
// checkSleep // checkSleep
// //
checkSleep.AccessibleName = "Sleep Backlight";
checkSleep.Dock = DockStyle.Fill; checkSleep.Dock = DockStyle.Fill;
checkSleep.Location = new Point(4, 131); checkSleep.Location = new Point(4, 131);
checkSleep.Margin = new Padding(4, 0, 4, 0); checkSleep.Margin = new Padding(4, 0, 4, 0);
@@ -825,7 +809,6 @@ namespace GHelper
// //
// checkShutdown // checkShutdown
// //
checkShutdown.AccessibleName = "Shutdown Backlight";
checkShutdown.Dock = DockStyle.Fill; checkShutdown.Dock = DockStyle.Fill;
checkShutdown.Location = new Point(4, 174); checkShutdown.Location = new Point(4, 174);
checkShutdown.Margin = new Padding(4, 0, 4, 0); checkShutdown.Margin = new Padding(4, 0, 4, 0);
@@ -1065,7 +1048,6 @@ namespace GHelper
// //
// panelSettings // panelSettings
// //
panelSettings.AccessibleName = "Extra Settings";
panelSettings.AccessibleRole = AccessibleRole.Grouping; panelSettings.AccessibleRole = AccessibleRole.Grouping;
panelSettings.AutoSize = true; panelSettings.AutoSize = true;
panelSettings.AutoSizeMode = AutoSizeMode.GrowAndShrink; panelSettings.AutoSizeMode = AutoSizeMode.GrowAndShrink;
@@ -1200,7 +1182,6 @@ namespace GHelper
// //
// numericHibernateAfter // numericHibernateAfter
// //
numericHibernateAfter.AccessibleName = "Minutes till Hibernation in sleep";
numericHibernateAfter.Anchor = AnchorStyles.Top | AnchorStyles.Right; numericHibernateAfter.Anchor = AnchorStyles.Top | AnchorStyles.Right;
numericHibernateAfter.Increment = new decimal(new int[] { 10, 0, 0, 0 }); numericHibernateAfter.Increment = new decimal(new int[] { 10, 0, 0, 0 });
numericHibernateAfter.Location = new Point(810, 7); numericHibernateAfter.Location = new Point(810, 7);
@@ -1247,7 +1228,6 @@ namespace GHelper
// //
// comboAPU // comboAPU
// //
comboAPU.AccessibleName = "Keyboard Animation Speed";
comboAPU.Anchor = AnchorStyles.Top | AnchorStyles.Right; comboAPU.Anchor = AnchorStyles.Top | AnchorStyles.Right;
comboAPU.BorderColor = Color.White; comboAPU.BorderColor = Color.White;
comboAPU.ButtonColor = SystemColors.ControlLight; comboAPU.ButtonColor = SystemColors.ControlLight;
@@ -1287,6 +1267,7 @@ namespace GHelper
// //
AutoScaleDimensions = new SizeF(192F, 192F); AutoScaleDimensions = new SizeF(192F, 192F);
AutoScaleMode = AutoScaleMode.Dpi; AutoScaleMode = AutoScaleMode.Dpi;
AutoScroll = true;
AutoSize = true; AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink; AutoSizeMode = AutoSizeMode.GrowAndShrink;
ClientSize = new Size(1013, 1515); ClientSize = new Size(1013, 1515);

View File

@@ -143,6 +143,34 @@ namespace GHelper
Text = Properties.Strings.ExtraSettings; Text = Properties.Strings.ExtraSettings;
// Accessible Labels
panelServices.AccessibleName = Properties.Strings.AsusServicesRunning;
panelBindings.AccessibleName = Properties.Strings.KeyBindings;
tableBindings.AccessibleName = Properties.Strings.KeyBindings;
comboM1.AccessibleName = "M1 Action";
comboM2.AccessibleName = "M2 Action";
comboM3.AccessibleName = "M3 Action";
comboM4.AccessibleName = "M4 Action";
comboFNF4.AccessibleName = "Fn+F4 Action";
comboFNC.AccessibleName = "Fn+C Action";
comboFNE.AccessibleName = "Fn+Numpad Action";
numericBacklightPluggedTime.AccessibleName = Properties.Strings.BacklightTimeoutPlugged;
numericBacklightTime.AccessibleName = Properties.Strings.BacklightTimeoutBattery;
comboKeyboardSpeed.AccessibleName = Properties.Strings.LaptopBacklight + " " +Properties.Strings.AnimationSpeed;
comboAPU.AccessibleName = Properties.Strings.LaptopBacklight + " " + Properties.Strings.AnimationSpeed;
checkBoot.AccessibleName = Properties.Strings.Boot + " " + Properties.Strings.LaptopBacklight;
checkAwake.AccessibleName = Properties.Strings.Awake + " " + Properties.Strings.LaptopBacklight;
checkSleep.AccessibleName = Properties.Strings.Sleep + " " + Properties.Strings.LaptopBacklight;
checkShutdown.AccessibleName = Properties.Strings.Shutdown + " " + Properties.Strings.LaptopBacklight;
panelSettings.AccessibleName = Properties.Strings.ExtraSettings;
numericHibernateAfter.AccessibleName = Properties.Strings.HibernateAfter;
if (AppConfig.IsARCNM()) if (AppConfig.IsARCNM())
{ {
labelM3.Text = "FN+F6"; labelM3.Text = "FN+F6";
@@ -351,7 +379,7 @@ namespace GHelper
pictureLog.Click += PictureLog_Click; pictureLog.Click += PictureLog_Click;
checkGPUFix.Visible = AppConfig.IsGPUFixNeeded(); checkGPUFix.Visible = Program.acpi.IsNVidiaGPU();
checkGPUFix.Checked = AppConfig.IsGPUFix(); checkGPUFix.Checked = AppConfig.IsGPUFix();
checkGPUFix.CheckedChanged += CheckGPUFix_CheckedChanged; checkGPUFix.CheckedChanged += CheckGPUFix_CheckedChanged;
@@ -606,7 +634,17 @@ namespace GHelper
{ {
if (Height > Program.settingsForm.Height) if (Height > Program.settingsForm.Height)
{ {
Top = Program.settingsForm.Top + Program.settingsForm.Height - Height; var top = Program.settingsForm.Top + Program.settingsForm.Height - Height;
if (top < 0)
{
MaximumSize = new Size(Width, Program.settingsForm.Height);
Top = Program.settingsForm.Top;
} else
{
Top = top;
}
} }
else else
{ {

View File

@@ -15,7 +15,7 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> <ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.142</AssemblyVersion> <AssemblyVersion>0.145</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -13,10 +13,10 @@ public class NvidiaGpuControl : IGpuControl
{ {
public static int MaxCoreOffset => AppConfig.Get("max_gpu_core", 250); public static int MaxCoreOffset => AppConfig.Get("max_gpu_core", 250);
public static int MaxMemoryOffset => AppConfig.Get("max_gpu_memory", 250); public static int MaxMemoryOffset => AppConfig.Get("max_gpu_memory", 500);
public static int MinCoreOffset = AppConfig.Get("min_gpu_core", -250); public static int MinCoreOffset = AppConfig.Get("min_gpu_core", -250);
public static int MinMemoryOffset = AppConfig.Get("min_gpu_memory", -250); public static int MinMemoryOffset = AppConfig.Get("min_gpu_memory", -500);
public const int MinClockLimit = 400; public const int MinClockLimit = 400;
public const int MaxClockLimit = 3000; public const int MaxClockLimit = 3000;

View File

@@ -429,7 +429,9 @@ namespace GHelper.Input
NativeMethods.TurnOffScreen(); NativeMethods.TurnOffScreen();
break; break;
case "miniled": case "miniled":
screenControl.ToogleMiniled(); if (ScreenCCD.GetHDRStatus()) return;
int miniled = screenControl.ToogleMiniled();
Program.toast.RunToast(miniled == 1 ? "Multi-Zone" : "Single-Zone", miniled == 1 ? ToastIcon.BrightnessUp : ToastIcon.BrightnessDown);
break; break;
case "aura": case "aura":
Program.settingsForm.BeginInvoke(Program.settingsForm.CycleAuraMode); Program.settingsForm.BeginInvoke(Program.settingsForm.CycleAuraMode);

View File

@@ -348,16 +348,20 @@ namespace GHelper.Mode
int gpu_boost = AppConfig.GetMode("gpu_boost"); int gpu_boost = AppConfig.GetMode("gpu_boost");
int gpu_temp = AppConfig.GetMode("gpu_temp"); int gpu_temp = AppConfig.GetMode("gpu_temp");
int boostResult = -1;
if (gpu_boost < AsusACPI.MinGPUBoost || gpu_boost > AsusACPI.MaxGPUBoost) return; if (gpu_boost < AsusACPI.MinGPUBoost || gpu_boost > AsusACPI.MaxGPUBoost) return;
if (gpu_temp < AsusACPI.MinGPUTemp || gpu_temp > AsusACPI.MaxGPUTemp) return; if (gpu_temp < AsusACPI.MinGPUTemp || gpu_temp > AsusACPI.MaxGPUTemp) return;
if (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0) if (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0)
Program.acpi.DeviceSet(AsusACPI.PPT_GPUC0, gpu_boost, "PowerLimit C0"); boostResult = Program.acpi.DeviceSet(AsusACPI.PPT_GPUC0, gpu_boost, "PowerLimit C0");
if (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0) if (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0)
Program.acpi.DeviceSet(AsusACPI.PPT_GPUC2, gpu_temp, "PowerLimit C2"); Program.acpi.DeviceSet(AsusACPI.PPT_GPUC2, gpu_temp, "PowerLimit C2");
if (boostResult == 0)
Program.acpi.DeviceSet(AsusACPI.PPT_GPUC0, gpu_boost, "PowerLimit C0");
} }
public void SetCPUTemp(int? cpuTemp, bool log = true) public void SetCPUTemp(int? cpuTemp, bool log = true)

View File

@@ -0,0 +1,243 @@
namespace GHelper.Peripherals.Mouse.Models
{
//P504
public class GladiusIIOrigin : AsusMouse
{
public GladiusIIOrigin() : base(0x0B05, 0x1877, "mi_02", false)
{
}
public GladiusIIOrigin(ushort productId, string path) : base(0x0B05, productId, path, false)
{
}
public override int DPIProfileCount()
{
return 2;
}
public override string GetDisplayName()
{
return "Gladius II Origin";
}
public override PollingRate[] SupportedPollingrates()
{
return new PollingRate[] {
PollingRate.PR125Hz,
PollingRate.PR250Hz,
PollingRate.PR500Hz,
PollingRate.PR1000Hz
};
}
public override int ProfileCount()
{
return 1;
}
public override int MaxDPI()
{
return 12_000;
}
public override bool HasRGB()
{
return true;
}
public override bool HasAutoPowerOff()
{
return false;
}
public override bool HasAngleSnapping()
{
return true;
}
public override bool HasAngleTuning()
{
return false;
}
public override bool HasDebounceSetting()
{
return true;
}
public override bool HasLiftOffSetting()
{
return true;
}
public override bool HasLowBatteryWarning()
{
return false;
}
public override bool HasBattery()
{
return false;
}
public override bool HasDPIColors()
{
return false;
}
public override bool IsLightingModeSupported(LightingMode lightingMode)
{
return lightingMode == LightingMode.Static
|| lightingMode == LightingMode.Breathing
|| lightingMode == LightingMode.ColorCycle
|| lightingMode == LightingMode.Rainbow
|| lightingMode == LightingMode.React
|| lightingMode == LightingMode.Comet;
}
public override LightingZone[] SupportedLightingZones()
{
return new LightingZone[] { LightingZone.Logo, LightingZone.Scrollwheel, LightingZone.Underglow };
}
public override int DPIIncrements()
{
return 100;
}
public override bool CanChangeDPIProfile()
{
return true;
}
public override int MaxBrightness()
{
return 4;
}
protected override byte[] GetUpdateLightingModePacket(LightingSetting lightingSetting, LightingZone zone)
{
/*
* This mouse uses different speed values for rainbow mode compared to others.
* 51 28 03 00 03 04 FF 00 00 00 00 [8C] 00 00 00 00
* 51 28 03 00 03 04 FF 00 00 00 00 [64] 00 00 00 00
* 51 28 03 00 03 04 FF 00 00 00 00 [3F] 00 00 00 00
*/
if (lightingSetting.LightingMode == LightingMode.Rainbow)
{
byte speed = 0x3F;
switch (lightingSetting.AnimationSpeed)
{
case AnimationSpeed.Slow:
speed = 0x3F;
break;
case AnimationSpeed.Medium:
speed = 0x64;
break;
case AnimationSpeed.Fast:
speed = 0x8C;
break;
}
return new byte[] { reportId, 0x51, 0x28, (byte)zone, 0x00,
IndexForLightingMode(lightingSetting.LightingMode),
(byte)lightingSetting.Brightness,
0xFF, 0x00, 0x00,
(byte)(SupportsAnimationDirection(lightingSetting.LightingMode) ? lightingSetting.AnimationDirection : 0x00),
(byte)((lightingSetting.RandomColor && SupportsRandomColor(lightingSetting.LightingMode)) ? 0x01: 0x00),
(byte)(SupportsAnimationSpeed(lightingSetting.LightingMode) ? speed : 0x00)
};
}
return base.GetUpdateLightingModePacket(lightingSetting, zone);
}
protected override byte[] GetReadLightingModePacket(LightingZone zone)
{
return new byte[] { 0x00, 0x12, 0x03, 0x00 };
}
protected LightingSetting? ParseLightingSetting(byte[] packet, LightingZone zone)
{
if (packet[1] != 0x12 || packet[2] != 0x03)
{
return null;
}
int offset = 5 + (((int)zone) * 5);
LightingSetting setting = new LightingSetting();
setting.LightingMode = LightingModeForIndex(packet[offset + 0]);
setting.Brightness = packet[offset + 1];
setting.RGBColor = Color.FromArgb(packet[offset + 2], packet[offset + 3], packet[offset + 4]);
return setting;
}
public override void ReadLightingSetting()
{
if (!HasRGB())
{
return;
}
//Mouse sends all lighting zones in one response Direction, Random col, Speed
//00 12 03 00 00 [00 04 ff 00 80] [00 04 00 ff ff] [00 04 ff ff ff] 00 [00] [00] [00] 00 00
//00 12 03 00 00 [03 04 00 00 00] [03 04 00 00 00] [03 04 00 00 00] 00 [00] [00] [07] 00 00
byte[]? response = WriteForResponse(GetReadLightingModePacket(LightingZone.All));
if (response is null) return;
LightingZone[] lz = SupportedLightingZones();
for (int i = 0; i < lz.Length; ++i)
{
LightingSetting? ls = ParseLightingSetting(response, lz[i]);
if (ls is null)
{
Logger.WriteLine(GetDisplayName() + ": Failed to read RGB Setting for Zone " + lz[i].ToString());
continue;
}
ls.AnimationDirection = SupportsAnimationDirection(ls.LightingMode)
? (AnimationDirection)response[21]
: AnimationDirection.Clockwise;
ls.RandomColor = SupportsRandomColor(ls.LightingMode) && response[22] == 0x01;
ls.AnimationSpeed = SupportsAnimationSpeed(ls.LightingMode)
? (AnimationSpeed)response[23]
: AnimationSpeed.Medium;
if (ls.AnimationSpeed != AnimationSpeed.Fast
&& ls.AnimationSpeed != AnimationSpeed.Medium
&& ls.AnimationSpeed != AnimationSpeed.Slow)
{
ls.AnimationSpeed = AnimationSpeed.Medium;
}
Logger.WriteLine(GetDisplayName() + ": Read RGB Setting for Zone " + lz[i].ToString() + ": " + ls.ToString());
LightingSetting[i] = ls;
}
}
}
//P502
public class GladiusII : GladiusIIOrigin
{
public GladiusII() : base(0x1845, "mi_02")
{
}
public override string GetDisplayName()
{
return "Gladius II Origin";
}
public override int ProfileCount()
{
return 3;
}
}
}

View File

@@ -187,6 +187,8 @@ namespace GHelper.Peripherals
DetectMouse(new ChakramXWired()); DetectMouse(new ChakramXWired());
DetectMouse(new GladiusIIIAimpoint()); DetectMouse(new GladiusIIIAimpoint());
DetectMouse(new GladiusIIIAimpointWired()); DetectMouse(new GladiusIIIAimpointWired());
DetectMouse(new GladiusIIOrigin());
DetectMouse(new GladiusII());
DetectMouse(new ROGKerisWireless()); DetectMouse(new ROGKerisWireless());
DetectMouse(new ROGKerisWirelessWired()); DetectMouse(new ROGKerisWirelessWired());
DetectMouse(new ROGKerisWirelessEvaEdition()); DetectMouse(new ROGKerisWirelessEvaEdition());

View File

@@ -456,6 +456,24 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Backlight Timeout when on battery.
/// </summary>
internal static string BacklightTimeoutBattery {
get {
return ResourceManager.GetString("BacklightTimeoutBattery", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Backlight Timeout when plugged.
/// </summary>
internal static string BacklightTimeoutPlugged {
get {
return ResourceManager.GetString("BacklightTimeoutPlugged", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Balanced. /// Looks up a localized string similar to Balanced.
/// </summary> /// </summary>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Timeout angeschlossen / bei Akku (0 - AN)</value> <value>Timeout angeschlossen / bei Akku (0 - AN)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Ausbalanciert</value> <value>Ausbalanciert</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Tiempo de espera conectado / con batería (0 - ON)</value> <value>Tiempo de espera conectado / con batería (0 - ON)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Tiempo de retroiluminación con batería</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Tiempo de retroiluminación conectado</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Equilibrado</value> <value>Equilibrado</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Délai branché / sur batterie (0 - ON)</value> <value>Délai branché / sur batterie (0 - ON)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Équilibré</value> <value>Équilibré</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Késleltetés töltés / akku módban (0 - BE)</value> <value>Késleltetés töltés / akku módban (0 - BE)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Teljesítmény</value> <value>Teljesítmény</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Waktu tunggu dicolokan / menggunakan baterai (0 - Hidup)</value> <value>Waktu tunggu dicolokan / menggunakan baterai (0 - Hidup)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Seimbang</value> <value>Seimbang</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Timeout in carica / a batteria (0 - ACCESO)</value> <value>Timeout in carica / a batteria (0 - ACCESO)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Bilanciato</value> <value>Bilanciato</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>전원 / 배터리 사용 중 자동 꺼짐 시간 (0 - 항상 켜짐)</value> <value>전원 / 배터리 사용 중 자동 꺼짐 시간 (0 - 항상 켜짐)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>균형</value> <value>균형</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Laiko riba su lizdu / akumuliatoriumi (0 ĮJUNGTA)</value> <value>Laiko riba su lizdu / akumuliatoriumi (0 ĮJUNGTA)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Balansuotas</value> <value>Balansuotas</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Limit czasu podłączonego / na baterii (0 - Włączony)</value> <value>Limit czasu podłączonego / na baterii (0 - Włączony)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Czas podświetlenia na baterii</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Czas podświetlenia po podłączeniu</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Balans</value> <value>Balans</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Tempo limite plugado / na bateria (0 - ligado)</value> <value>Tempo limite plugado / na bateria (0 - ligado)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Equilibrado</value> <value>Equilibrado</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Tempo limite ligado à corrente / na bateria (0 - ON)</value> <value>Tempo limite ligado à corrente / na bateria (0 - ON)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Equilibrado</value> <value>Equilibrado</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Timeout plugged / on battery (0 - ON)</value> <value>Timeout plugged / on battery (0 - ON)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Balanced</value> <value>Balanced</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Timeout conectat / folosind bateria (0 - ON)</value> <value>Timeout conectat / folosind bateria (0 - ON)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Echilibrat</value> <value>Echilibrat</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Pildeyken klavye ışığının kapanma süresi</value> <value>Pildeyken klavye ışığının kapanma süresi</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Dengeli</value> <value>Dengeli</value>
</data> </data>

View File

@@ -124,10 +124,10 @@
<value>Не вдається під'єднатися до ASUS ACPI. Програма не може працювати без нього. Спробуйте встановити Asus System Control Interface</value> <value>Не вдається під'єднатися до ASUS ACPI. Програма не може працювати без нього. Спробуйте встановити Asus System Control Interface</value>
</data> </data>
<data name="AlertAPUMemoryRestart" xml:space="preserve"> <data name="AlertAPUMemoryRestart" xml:space="preserve">
<value>Restart your device to apply changes</value> <value>Перезавантажте ваш пристрій, щоб зміни набули чинності</value>
</data> </data>
<data name="AlertAPUMemoryRestartTitle" xml:space="preserve"> <data name="AlertAPUMemoryRestartTitle" xml:space="preserve">
<value>Restart now?</value> <value>Перезавантажити зараз?</value>
</data> </data>
<data name="AlertDGPU" xml:space="preserve"> <data name="AlertDGPU" xml:space="preserve">
<value>Здається, що GPU використовується, вимкнути її?</value> <value>Здається, що GPU використовується, вимкнути її?</value>
@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Тайм-аут на зарядці / на батареї (0 - УВІМК)</value> <value>Тайм-аут на зарядці / на батареї (0 - УВІМК)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Баланс</value> <value>Баланс</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Số giây để tắt đèn nền bàn phím(khi dùng pin)</value> <value>Số giây để tắt đèn nền bàn phím(khi dùng pin)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Cân bằng</value> <value>Cân bằng</value>
</data> </data>

View File

@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>插电/电池时熄灭时间0表示长亮</value> <value>插电/电池时熄灭时间0表示长亮</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>充电模式下的背光超时</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>电源模式下的背光超时</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>平衡模式</value> <value>平衡模式</value>
</data> </data>

View File

@@ -124,10 +124,10 @@
<value>無法連結到華碩 ACPI。 没有它,應用程式將無法執行。 嘗試安裝Asus System Control Interface</value> <value>無法連結到華碩 ACPI。 没有它,應用程式將無法執行。 嘗試安裝Asus System Control Interface</value>
</data> </data>
<data name="AlertAPUMemoryRestart" xml:space="preserve"> <data name="AlertAPUMemoryRestart" xml:space="preserve">
<value>Restart your device to apply changes</value> <value>重新啟動裝置以套用變更</value>
</data> </data>
<data name="AlertAPUMemoryRestartTitle" xml:space="preserve"> <data name="AlertAPUMemoryRestartTitle" xml:space="preserve">
<value>Restart now?</value> <value>現在重新啟動?</value>
</data> </data>
<data name="AlertDGPU" xml:space="preserve"> <data name="AlertDGPU" xml:space="preserve">
<value>看起来 GPU 正在大量使用,是否禁用它?</value> <value>看起来 GPU 正在大量使用,是否禁用它?</value>
@@ -169,7 +169,7 @@
<value>自動調整Windows電源模式</value> <value>自動調整Windows電源模式</value>
</data> </data>
<data name="APUMemory" xml:space="preserve"> <data name="APUMemory" xml:space="preserve">
<value>Memory Assigned to GPU</value> <value>分配給GPU的記憶體</value>
</data> </data>
<data name="AsusServicesRunning" xml:space="preserve"> <data name="AsusServicesRunning" xml:space="preserve">
<value>執行中的華碩服務</value> <value>執行中的華碩服務</value>
@@ -249,6 +249,12 @@
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>閒置幾秒後關閉燈光:插電時 / 使用電池 (0 = 不關閉)</value> <value>閒置幾秒後關閉燈光:插電時 / 使用電池 (0 = 不關閉)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value>
</data>
<data name="BacklightTimeoutPlugged" xml:space="preserve">
<value>Backlight Timeout when plugged</value>
</data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>平衡模式</value> <value>平衡模式</value>
</data> </data>

View File

@@ -145,7 +145,6 @@ namespace GHelper
// //
// panelMatrix // panelMatrix
// //
panelMatrix.AccessibleName = "Anime Matrix";
panelMatrix.AccessibleRole = AccessibleRole.Grouping; panelMatrix.AccessibleRole = AccessibleRole.Grouping;
panelMatrix.AutoSize = true; panelMatrix.AutoSize = true;
panelMatrix.AutoSizeMode = AutoSizeMode.GrowAndShrink; panelMatrix.AutoSizeMode = AutoSizeMode.GrowAndShrink;
@@ -312,7 +311,6 @@ namespace GHelper
// //
// sliderBattery // sliderBattery
// //
sliderBattery.AccessibleName = "Battery Charge Limit";
sliderBattery.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; sliderBattery.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
sliderBattery.Location = new Point(20, 65); sliderBattery.Location = new Point(20, 65);
sliderBattery.Margin = new Padding(4); sliderBattery.Margin = new Padding(4);
@@ -420,7 +418,6 @@ namespace GHelper
// //
// buttonQuit // buttonQuit
// //
buttonQuit.AccessibleName = "Quit Application";
buttonQuit.Activated = false; buttonQuit.Activated = false;
buttonQuit.BackColor = SystemColors.ControlLight; buttonQuit.BackColor = SystemColors.ControlLight;
buttonQuit.BorderColor = Color.Transparent; buttonQuit.BorderColor = Color.Transparent;
@@ -441,7 +438,6 @@ namespace GHelper
// //
// buttonUpdates // buttonUpdates
// //
buttonUpdates.AccessibleName = "BIOS and Driver Updates";
buttonUpdates.Activated = false; buttonUpdates.Activated = false;
buttonUpdates.BackColor = SystemColors.ControlLight; buttonUpdates.BackColor = SystemColors.ControlLight;
buttonUpdates.BorderColor = Color.Transparent; buttonUpdates.BorderColor = Color.Transparent;
@@ -473,7 +469,6 @@ namespace GHelper
// //
// panelPerformance // panelPerformance
// //
panelPerformance.AccessibleName = "Performance";
panelPerformance.AccessibleRole = AccessibleRole.Grouping; panelPerformance.AccessibleRole = AccessibleRole.Grouping;
panelPerformance.AutoSize = true; panelPerformance.AutoSize = true;
panelPerformance.AutoSizeMode = AutoSizeMode.GrowAndShrink; panelPerformance.AutoSizeMode = AutoSizeMode.GrowAndShrink;
@@ -512,7 +507,6 @@ namespace GHelper
// //
// buttonSilent // buttonSilent
// //
buttonSilent.AccessibleName = "Silent Mode";
buttonSilent.Activated = false; buttonSilent.Activated = false;
buttonSilent.BackColor = SystemColors.ControlLightLight; buttonSilent.BackColor = SystemColors.ControlLightLight;
buttonSilent.BackgroundImageLayout = ImageLayout.None; buttonSilent.BackgroundImageLayout = ImageLayout.None;
@@ -536,7 +530,6 @@ namespace GHelper
// //
// buttonBalanced // buttonBalanced
// //
buttonBalanced.AccessibleName = "Balanced Mode";
buttonBalanced.Activated = false; buttonBalanced.Activated = false;
buttonBalanced.BackColor = SystemColors.ControlLightLight; buttonBalanced.BackColor = SystemColors.ControlLightLight;
buttonBalanced.BorderColor = Color.Transparent; buttonBalanced.BorderColor = Color.Transparent;
@@ -559,7 +552,6 @@ namespace GHelper
// //
// buttonTurbo // buttonTurbo
// //
buttonTurbo.AccessibleName = "Turbo Mode";
buttonTurbo.Activated = false; buttonTurbo.Activated = false;
buttonTurbo.BackColor = SystemColors.ControlLightLight; buttonTurbo.BackColor = SystemColors.ControlLightLight;
buttonTurbo.BorderColor = Color.Transparent; buttonTurbo.BorderColor = Color.Transparent;
@@ -582,7 +574,6 @@ namespace GHelper
// //
// buttonFans // buttonFans
// //
buttonFans.AccessibleName = "Fans and Power Settings";
buttonFans.Activated = false; buttonFans.Activated = false;
buttonFans.BackColor = SystemColors.ControlLight; buttonFans.BackColor = SystemColors.ControlLight;
buttonFans.BorderColor = Color.Transparent; buttonFans.BorderColor = Color.Transparent;
@@ -654,7 +645,6 @@ namespace GHelper
// //
// panelGPU // panelGPU
// //
panelGPU.AccessibleName = "GPU";
panelGPU.AccessibleRole = AccessibleRole.Grouping; panelGPU.AccessibleRole = AccessibleRole.Grouping;
panelGPU.AutoSize = true; panelGPU.AutoSize = true;
panelGPU.AutoSizeMode = AutoSizeMode.GrowAndShrink; panelGPU.AutoSizeMode = AutoSizeMode.GrowAndShrink;
@@ -731,7 +721,6 @@ namespace GHelper
// //
// buttonEco // buttonEco
// //
buttonEco.AccessibleName = "Eco GPU Mode";
buttonEco.Activated = false; buttonEco.Activated = false;
buttonEco.BackColor = SystemColors.ControlLightLight; buttonEco.BackColor = SystemColors.ControlLightLight;
buttonEco.BorderColor = Color.Transparent; buttonEco.BorderColor = Color.Transparent;
@@ -755,7 +744,6 @@ namespace GHelper
// //
// buttonStandard // buttonStandard
// //
buttonStandard.AccessibleName = "Standard GPU Mode";
buttonStandard.Activated = false; buttonStandard.Activated = false;
buttonStandard.BackColor = SystemColors.ControlLightLight; buttonStandard.BackColor = SystemColors.ControlLightLight;
buttonStandard.BorderColor = Color.Transparent; buttonStandard.BorderColor = Color.Transparent;
@@ -801,7 +789,6 @@ namespace GHelper
// //
// buttonOptimized // buttonOptimized
// //
buttonOptimized.AccessibleName = "Optimized GPU Mode";
buttonOptimized.Activated = false; buttonOptimized.Activated = false;
buttonOptimized.BackColor = SystemColors.ControlLightLight; buttonOptimized.BackColor = SystemColors.ControlLightLight;
buttonOptimized.BorderColor = Color.Transparent; buttonOptimized.BorderColor = Color.Transparent;
@@ -824,7 +811,6 @@ namespace GHelper
// //
// buttonUltimate // buttonUltimate
// //
buttonUltimate.AccessibleName = "Ultimate GPU Mode";
buttonUltimate.Activated = false; buttonUltimate.Activated = false;
buttonUltimate.BackColor = SystemColors.ControlLightLight; buttonUltimate.BackColor = SystemColors.ControlLightLight;
buttonUltimate.BorderColor = Color.Transparent; buttonUltimate.BorderColor = Color.Transparent;
@@ -892,7 +878,6 @@ namespace GHelper
// //
// panelScreen // panelScreen
// //
panelScreen.AccessibleName = "Screen";
panelScreen.AccessibleRole = AccessibleRole.Grouping; panelScreen.AccessibleRole = AccessibleRole.Grouping;
panelScreen.AutoSize = true; panelScreen.AutoSize = true;
panelScreen.AutoSizeMode = AutoSizeMode.GrowAndShrink; panelScreen.AutoSizeMode = AutoSizeMode.GrowAndShrink;
@@ -942,7 +927,6 @@ namespace GHelper
// //
// buttonScreenAuto // buttonScreenAuto
// //
buttonScreenAuto.AccessibleName = "Auto Screen Refresh Rate";
buttonScreenAuto.Activated = false; buttonScreenAuto.Activated = false;
buttonScreenAuto.BackColor = SystemColors.ControlLightLight; buttonScreenAuto.BackColor = SystemColors.ControlLightLight;
buttonScreenAuto.BorderColor = Color.Transparent; buttonScreenAuto.BorderColor = Color.Transparent;
@@ -962,7 +946,6 @@ namespace GHelper
// //
// button60Hz // button60Hz
// //
button60Hz.AccessibleName = "60Hz Refresh Rate";
button60Hz.Activated = false; button60Hz.Activated = false;
button60Hz.BackColor = SystemColors.ControlLightLight; button60Hz.BackColor = SystemColors.ControlLightLight;
button60Hz.BorderColor = Color.Transparent; button60Hz.BorderColor = Color.Transparent;
@@ -983,7 +966,6 @@ namespace GHelper
// //
// button120Hz // button120Hz
// //
button120Hz.AccessibleName = "Maximum Refresh Rate";
button120Hz.Activated = false; button120Hz.Activated = false;
button120Hz.BackColor = SystemColors.ControlLightLight; button120Hz.BackColor = SystemColors.ControlLightLight;
button120Hz.BorderColor = Color.Transparent; button120Hz.BorderColor = Color.Transparent;
@@ -1068,7 +1050,6 @@ namespace GHelper
// //
// panelKeyboard // panelKeyboard
// //
panelKeyboard.AccessibleName = "Keyboard";
panelKeyboard.AccessibleRole = AccessibleRole.Grouping; panelKeyboard.AccessibleRole = AccessibleRole.Grouping;
panelKeyboard.AutoSize = true; panelKeyboard.AutoSize = true;
panelKeyboard.AutoSizeMode = AutoSizeMode.GrowAndShrink; panelKeyboard.AutoSizeMode = AutoSizeMode.GrowAndShrink;
@@ -1105,7 +1086,6 @@ namespace GHelper
// //
// buttonKeyboard // buttonKeyboard
// //
buttonKeyboard.AccessibleName = "Extra Settings";
buttonKeyboard.Activated = false; buttonKeyboard.Activated = false;
buttonKeyboard.BackColor = SystemColors.ControlLight; buttonKeyboard.BackColor = SystemColors.ControlLight;
buttonKeyboard.BorderColor = Color.Transparent; buttonKeyboard.BorderColor = Color.Transparent;
@@ -1160,7 +1140,6 @@ namespace GHelper
// //
// buttonKeyboardColor // buttonKeyboardColor
// //
buttonKeyboardColor.AccessibleName = "Keyboard Color";
buttonKeyboardColor.Activated = false; buttonKeyboardColor.Activated = false;
buttonKeyboardColor.BackColor = SystemColors.ButtonHighlight; buttonKeyboardColor.BackColor = SystemColors.ButtonHighlight;
buttonKeyboardColor.BorderColor = Color.Transparent; buttonKeyboardColor.BorderColor = Color.Transparent;
@@ -1179,7 +1158,6 @@ namespace GHelper
// //
// comboKeyboard // comboKeyboard
// //
comboKeyboard.AccessibleName = "Keyboard Backlight Mode";
comboKeyboard.BorderColor = Color.White; comboKeyboard.BorderColor = Color.White;
comboKeyboard.ButtonColor = Color.FromArgb(255, 255, 255); comboKeyboard.ButtonColor = Color.FromArgb(255, 255, 255);
comboKeyboard.Dock = DockStyle.Top; comboKeyboard.Dock = DockStyle.Top;
@@ -1310,7 +1288,6 @@ namespace GHelper
// //
// buttonPeripheral3 // buttonPeripheral3
// //
buttonPeripheral3.AccessibleName = "Peripheral 3";
buttonPeripheral3.Activated = false; buttonPeripheral3.Activated = false;
buttonPeripheral3.BackColor = SystemColors.ControlLightLight; buttonPeripheral3.BackColor = SystemColors.ControlLightLight;
buttonPeripheral3.BorderColor = Color.Transparent; buttonPeripheral3.BorderColor = Color.Transparent;
@@ -1335,7 +1312,6 @@ namespace GHelper
// //
// buttonPeripheral2 // buttonPeripheral2
// //
buttonPeripheral2.AccessibleName = "Peripheral 2";
buttonPeripheral2.Activated = false; buttonPeripheral2.Activated = false;
buttonPeripheral2.BackColor = SystemColors.ControlLightLight; buttonPeripheral2.BackColor = SystemColors.ControlLightLight;
buttonPeripheral2.BorderColor = Color.Transparent; buttonPeripheral2.BorderColor = Color.Transparent;
@@ -1360,7 +1336,6 @@ namespace GHelper
// //
// buttonPeripheral1 // buttonPeripheral1
// //
buttonPeripheral1.AccessibleName = "Peripheral 1";
buttonPeripheral1.Activated = false; buttonPeripheral1.Activated = false;
buttonPeripheral1.BackColor = SystemColors.ControlLightLight; buttonPeripheral1.BackColor = SystemColors.ControlLightLight;
buttonPeripheral1.BorderColor = Color.Transparent; buttonPeripheral1.BorderColor = Color.Transparent;

View File

@@ -87,6 +87,33 @@ namespace GHelper
buttonQuit.Text = Properties.Strings.Quit; buttonQuit.Text = Properties.Strings.Quit;
buttonUpdates.Text = Properties.Strings.Updates; buttonUpdates.Text = Properties.Strings.Updates;
// Accessible Labels
panelMatrix.AccessibleName = Properties.Strings.AnimeMatrix;
sliderBattery.AccessibleName = Properties.Strings.BatteryChargeLimit;
buttonQuit.AccessibleName = Properties.Strings.Quit;
buttonUpdates.AccessibleName = Properties.Strings.BiosAndDriverUpdates;
panelPerformance.AccessibleName = Properties.Strings.PerformanceMode;
buttonSilent.AccessibleName = Properties.Strings.Silent;
buttonBalanced.AccessibleName = Properties.Strings.Balanced;
buttonTurbo.AccessibleName = Properties.Strings.Turbo;
buttonFans.AccessibleName = Properties.Strings.FansAndPower;
panelGPU.AccessibleName = Properties.Strings.GPUMode;
buttonEco.AccessibleName = Properties.Strings.EcoMode;
buttonStandard.AccessibleName = Properties.Strings.StandardMode;
buttonOptimized.AccessibleName = Properties.Strings.Optimized;
buttonUltimate.AccessibleName = Properties.Strings.UltimateMode;
panelScreen.AccessibleName = Properties.Strings.LaptopScreen;
buttonScreenAuto.AccessibleName = Properties.Strings.AutoMode;
//button60Hz.AccessibleName = "60Hz Refresh Rate";
//button120Hz.AccessibleName = "Maximum Refresh Rate";
panelKeyboard.AccessibleName = Properties.Strings.LaptopKeyboard;
buttonKeyboard.AccessibleName = Properties.Strings.ExtraSettings;
buttonKeyboardColor.AccessibleName = Properties.Strings.LaptopKeyboard + " " + Properties.Strings.Color;
comboKeyboard.AccessibleName = Properties.Strings.LaptopBacklight;
FormClosing += SettingsForm_FormClosing; FormClosing += SettingsForm_FormClosing;
Deactivate += SettingsForm_LostFocus; Deactivate += SettingsForm_LostFocus;
@@ -444,11 +471,17 @@ namespace GHelper
public void SetVersionLabel(string label, bool update = false) public void SetVersionLabel(string label, bool update = false)
{ {
Invoke(delegate if (InvokeRequired)
Invoke(delegate
{
labelVersion.Text = label;
if (update) labelVersion.ForeColor = colorTurbo;
});
else
{ {
labelVersion.Text = label; labelVersion.Text = label;
if (update) labelVersion.ForeColor = colorTurbo; if (update) labelVersion.ForeColor = colorTurbo;
}); }
} }
@@ -632,18 +665,14 @@ namespace GHelper
public void FansInit() public void FansInit()
{ {
Invoke(delegate if (fansForm == null || fansForm.Text == "") return;
{ Invoke(fansForm.InitAll);
if (fansForm != null && fansForm.Text != "") fansForm.InitAll();
});
} }
public void GPUInit() public void GPUInit()
{ {
Invoke(delegate if (fansForm == null || fansForm.Text == "") return;
{ Invoke(fansForm.InitGPU);
if (fansForm != null && fansForm.Text != "") fansForm.InitGPU();
});
} }
public void FansToggle(int index = 0) public void FansToggle(int index = 0)
@@ -737,12 +766,19 @@ namespace GHelper
public void VisualiseAura() public void VisualiseAura()
{ {
Invoke(delegate if (InvokeRequired)
Invoke(delegate
{
pictureColor.BackColor = Aura.Color1;
pictureColor2.BackColor = Aura.Color2;
pictureColor2.Visible = Aura.HasSecondColor();
});
else
{ {
pictureColor.BackColor = Aura.Color1; pictureColor.BackColor = Aura.Color1;
pictureColor2.BackColor = Aura.Color2; pictureColor2.BackColor = Aura.Color2;
pictureColor2.Visible = Aura.HasSecondColor(); pictureColor2.Visible = Aura.HasSecondColor();
}); }
} }
public void InitMatrix() public void InitMatrix()
@@ -974,18 +1010,19 @@ namespace GHelper
if (gpuTemp.Length > 0) trayTip += "\nGPU" + gpuTemp + " " + HardwareControl.gpuFan; if (gpuTemp.Length > 0) trayTip += "\nGPU" + gpuTemp + " " + HardwareControl.gpuFan;
if (battery.Length > 0) trayTip += "\n" + battery; if (battery.Length > 0) trayTip += "\n" + battery;
Program.settingsForm.BeginInvoke(delegate if (Program.settingsForm.IsHandleCreated)
{ Program.settingsForm.BeginInvoke(delegate
labelCPUFan.Text = "CPU" + cpuTemp + " " + HardwareControl.cpuFan; {
labelGPUFan.Text = "GPU" + gpuTemp + " " + HardwareControl.gpuFan; labelCPUFan.Text = "CPU" + cpuTemp + " " + HardwareControl.cpuFan;
if (HardwareControl.midFan is not null) labelGPUFan.Text = "GPU" + gpuTemp + " " + HardwareControl.gpuFan;
labelMidFan.Text = "Mid " + HardwareControl.midFan; if (HardwareControl.midFan is not null)
labelMidFan.Text = "Mid " + HardwareControl.midFan;
labelBattery.Text = battery; labelBattery.Text = battery;
if (!batteryMouseOver && !batteryFullMouseOver) labelCharge.Text = charge; if (!batteryMouseOver && !batteryFullMouseOver) labelCharge.Text = charge;
//panelPerformance.AccessibleName = labelPerf.Text + " " + trayTip; //panelPerformance.AccessibleName = labelPerf.Text + " " + trayTip;
}); });
Program.trayIcon.Text = trayTip; Program.trayIcon.Text = trayTip;
@@ -1000,52 +1037,67 @@ namespace GHelper
public void ShowMode(int mode) public void ShowMode(int mode)
{ {
Invoke(delegate if (InvokeRequired)
{ Invoke(delegate
buttonSilent.Activated = false;
buttonBalanced.Activated = false;
buttonTurbo.Activated = false;
buttonFans.Activated = false;
menuSilent.Checked = false;
menuBalanced.Checked = false;
menuTurbo.Checked = false;
switch (mode)
{ {
case AsusACPI.PerformanceSilent: VisualiseMode(mode);
buttonSilent.Activated = true; });
menuSilent.Checked = true; else
break; VisualiseMode(mode);
case AsusACPI.PerformanceTurbo: }
buttonTurbo.Activated = true;
menuTurbo.Checked = true; protected void VisualiseMode(int mode)
break; {
case AsusACPI.PerformanceBalanced: buttonSilent.Activated = false;
buttonBalanced.Activated = true; buttonBalanced.Activated = false;
menuBalanced.Checked = true; buttonTurbo.Activated = false;
break; buttonFans.Activated = false;
default:
buttonFans.Activated = true; menuSilent.Checked = false;
buttonFans.BorderColor = Modes.GetBase(mode) switch menuBalanced.Checked = false;
{ menuTurbo.Checked = false;
AsusACPI.PerformanceSilent => colorEco,
AsusACPI.PerformanceTurbo => colorTurbo, switch (mode)
_ => colorStandard, {
}; case AsusACPI.PerformanceSilent:
break; buttonSilent.Activated = true;
} menuSilent.Checked = true;
}); break;
case AsusACPI.PerformanceTurbo:
buttonTurbo.Activated = true;
menuTurbo.Checked = true;
break;
case AsusACPI.PerformanceBalanced:
buttonBalanced.Activated = true;
menuBalanced.Checked = true;
break;
default:
buttonFans.Activated = true;
buttonFans.BorderColor = Modes.GetBase(mode) switch
{
AsusACPI.PerformanceSilent => colorEco,
AsusACPI.PerformanceTurbo => colorTurbo,
_ => colorStandard,
};
break;
}
} }
public void SetModeLabel(string modeText) public void SetModeLabel(string modeText)
{ {
Invoke(delegate if (InvokeRequired)
{
Invoke(delegate {
labelPerf.Text = modeText;
panelPerformance.AccessibleName = labelPerf.Text;
});
} else
{ {
labelPerf.Text = modeText; labelPerf.Text = modeText;
panelPerformance.AccessibleName = labelPerf.Text; // + ". " + Program.trayIcon.Text; panelPerformance.AccessibleName = labelPerf.Text;
}); }
} }
@@ -1243,6 +1295,10 @@ namespace GHelper
{ {
labelBatteryTitle.Text = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%"; labelBatteryTitle.Text = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%";
sliderBattery.Value = limit; sliderBattery.Value = limit;
sliderBattery.AccessibleName = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%";
sliderBattery.AccessibilityObject.Select(AccessibleSelection.TakeFocus);
VisualiseBatteryFull(); VisualiseBatteryFull();
} }
@@ -1252,11 +1308,13 @@ namespace GHelper
{ {
buttonBatteryFull.BackColor = colorStandard; buttonBatteryFull.BackColor = colorStandard;
buttonBatteryFull.ForeColor = SystemColors.ControlLightLight; buttonBatteryFull.ForeColor = SystemColors.ControlLightLight;
buttonBatteryFull.AccessibleName = Properties.Strings.BatteryChargeLimit + "100% on";
} }
else else
{ {
buttonBatteryFull.BackColor = buttonSecond; buttonBatteryFull.BackColor = buttonSecond;
buttonBatteryFull.ForeColor = SystemColors.ControlDark; buttonBatteryFull.ForeColor = SystemColors.ControlDark;
buttonBatteryFull.AccessibleName = Properties.Strings.BatteryChargeLimit + "100% off";
} }
} }
@@ -1402,11 +1460,13 @@ namespace GHelper
{ {
buttonFnLock.BackColor = colorStandard; buttonFnLock.BackColor = colorStandard;
buttonFnLock.ForeColor = SystemColors.ControlLightLight; buttonFnLock.ForeColor = SystemColors.ControlLightLight;
buttonFnLock.AccessibleName = "Fn-Lock on";
} }
else else
{ {
buttonFnLock.BackColor = buttonSecond; buttonFnLock.BackColor = buttonSecond;
buttonFnLock.ForeColor = SystemColors.ControlDark; buttonFnLock.ForeColor = SystemColors.ControlDark;
buttonFnLock.AccessibleName = "Fn-Lock off";
} }
} }

View File

@@ -50,6 +50,9 @@ public static class ControlHelper
{ {
foreach (Control control in controls) foreach (Control control in controls)
{ {
AdjustControls(control.Controls);
var button = control as RButton; var button = control as RButton;
if (button != null) if (button != null)
{ {
@@ -132,7 +135,6 @@ public static class ControlHelper
} }
AdjustControls(control.Controls);
} }
} }

View File

@@ -1,6 +1,4 @@
using Microsoft.Win32; using Microsoft.Win32;
using System.ComponentModel;
using System.Drawing.Drawing2D;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace GHelper.UI namespace GHelper.UI
@@ -108,308 +106,4 @@ namespace GHelper.UI
} }
} }
public class RCheckBox : CheckBox
{
}
public class RComboBox : ComboBox
{
private Color borderColor = Color.Gray;
[DefaultValue(typeof(Color), "Gray")]
public Color BorderColor
{
get { return borderColor; }
set
{
if (borderColor != value)
{
borderColor = value;
Invalidate();
}
}
}
private Color buttonColor = Color.FromArgb(255, 255, 255, 255);
[DefaultValue(typeof(Color), "255, 255, 255")]
public Color ButtonColor
{
get { return buttonColor; }
set
{
if (buttonColor != value)
{
buttonColor = value;
Invalidate();
}
}
}
private Color arrowColor = Color.Black;
[DefaultValue(typeof(Color), "Black")]
public Color ArrowColor
{
get { return arrowColor; }
set
{
if (arrowColor != value)
{
arrowColor = value;
Invalidate();
}
}
}
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_PAINT && DropDownStyle != ComboBoxStyle.Simple)
{
var clientRect = ClientRectangle;
var dropDownButtonWidth = SystemInformation.HorizontalScrollBarArrowWidth;
var outerBorder = new Rectangle(clientRect.Location,
new Size(clientRect.Width - 1, clientRect.Height - 1));
var innerBorder = new Rectangle(outerBorder.X + 1, outerBorder.Y + 1,
outerBorder.Width - dropDownButtonWidth - 2, outerBorder.Height - 2);
var innerInnerBorder = new Rectangle(innerBorder.X + 1, innerBorder.Y + 1,
innerBorder.Width - 2, innerBorder.Height - 2);
var dropDownRect = new Rectangle(innerBorder.Right + 1, innerBorder.Y,
dropDownButtonWidth, innerBorder.Height + 1);
if (RightToLeft == RightToLeft.Yes)
{
innerBorder.X = clientRect.Width - innerBorder.Right;
innerInnerBorder.X = clientRect.Width - innerInnerBorder.Right;
dropDownRect.X = clientRect.Width - dropDownRect.Right;
dropDownRect.Width += 1;
}
var innerBorderColor = Enabled ? BackColor : SystemColors.Control;
var outerBorderColor = Enabled ? BorderColor : SystemColors.ControlDark;
var buttonColor = Enabled ? ButtonColor : SystemColors.Control;
var middle = new Point(dropDownRect.Left + dropDownRect.Width / 2,
dropDownRect.Top + dropDownRect.Height / 2);
var arrow = new Point[]
{
new Point(middle.X - 3, middle.Y - 2),
new Point(middle.X + 4, middle.Y - 2),
new Point(middle.X, middle.Y + 2)
};
var ps = new PAINTSTRUCT();
bool shoulEndPaint = false;
nint dc;
if (m.WParam == nint.Zero)
{
dc = BeginPaint(Handle, ref ps);
m.WParam = dc;
shoulEndPaint = true;
}
else
{
dc = m.WParam;
}
var rgn = CreateRectRgn(innerInnerBorder.Left, innerInnerBorder.Top,
innerInnerBorder.Right, innerInnerBorder.Bottom);
SelectClipRgn(dc, rgn);
DefWndProc(ref m);
DeleteObject(rgn);
rgn = CreateRectRgn(clientRect.Left, clientRect.Top,
clientRect.Right, clientRect.Bottom);
SelectClipRgn(dc, rgn);
using (var g = Graphics.FromHdc(dc))
{
using (var b = new SolidBrush(buttonColor))
{
g.FillRectangle(b, dropDownRect);
}
using (var b = new SolidBrush(arrowColor))
{
g.FillPolygon(b, arrow);
}
using (var p = new Pen(innerBorderColor))
{
g.DrawRectangle(p, innerBorder);
g.DrawRectangle(p, innerInnerBorder);
}
using (var p = new Pen(outerBorderColor))
{
g.DrawRectangle(p, outerBorder);
}
}
if (shoulEndPaint)
EndPaint(Handle, ref ps);
DeleteObject(rgn);
}
else
base.WndProc(ref m);
}
private const int WM_PAINT = 0xF;
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public int L, T, R, B;
}
[StructLayout(LayoutKind.Sequential)]
public struct PAINTSTRUCT
{
public nint hdc;
public bool fErase;
public int rcPaint_left;
public int rcPaint_top;
public int rcPaint_right;
public int rcPaint_bottom;
public bool fRestore;
public bool fIncUpdate;
public int reserved1;
public int reserved2;
public int reserved3;
public int reserved4;
public int reserved5;
public int reserved6;
public int reserved7;
public int reserved8;
}
[DllImport("user32.dll")]
private static extern nint BeginPaint(nint hWnd,
[In, Out] ref PAINTSTRUCT lpPaint);
[DllImport("user32.dll")]
private static extern bool EndPaint(nint hWnd, ref PAINTSTRUCT lpPaint);
[DllImport("gdi32.dll")]
public static extern int SelectClipRgn(nint hDC, nint hRgn);
[DllImport("user32.dll")]
public static extern int GetUpdateRgn(nint hwnd, nint hrgn, bool fErase);
public enum RegionFlags
{
ERROR = 0,
NULLREGION = 1,
SIMPLEREGION = 2,
COMPLEXREGION = 3,
}
[DllImport("gdi32.dll")]
internal static extern bool DeleteObject(nint hObject);
[DllImport("gdi32.dll")]
private static extern nint CreateRectRgn(int x1, int y1, int x2, int y2);
}
public class RButton : Button
{
//Fields
private int borderSize = 5;
private int borderRadius = 5;
public int BorderRadius
{
get { return borderRadius; }
set
{
borderRadius = value;
}
}
private Color borderColor = Color.Transparent;
public Color BorderColor
{
get { return borderColor; }
set
{
borderColor = value;
}
}
private bool activated = false;
public bool Activated
{
get { return activated; }
set
{
if (activated != value)
Invalidate();
activated = value;
}
}
private bool secondary = false;
public bool Secondary
{
get { return secondary; }
set
{
secondary = value;
}
}
public RButton()
{
DoubleBuffered = true;
FlatStyle = FlatStyle.Flat;
FlatAppearance.BorderSize = 0;
}
private GraphicsPath GetFigurePath(Rectangle rect, int radius)
{
GraphicsPath path = new GraphicsPath();
float curveSize = radius * 2F;
path.StartFigure();
path.AddArc(rect.X, rect.Y, curveSize, curveSize, 180, 90);
path.AddArc(rect.Right - curveSize, rect.Y, curveSize, curveSize, 270, 90);
path.AddArc(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize, 0, 90);
path.AddArc(rect.X, rect.Bottom - curveSize, curveSize, curveSize, 90, 90);
path.CloseFigure();
return path;
}
protected override void OnPaint(PaintEventArgs pevent)
{
base.OnPaint(pevent);
float ratio = pevent.Graphics.DpiX / 192.0f;
int border = (int)(ratio * borderSize);
Rectangle rectSurface = ClientRectangle;
Rectangle rectBorder = Rectangle.Inflate(rectSurface, -border, -border);
Color borderDrawColor = activated ? borderColor : Color.Transparent;
using (GraphicsPath pathSurface = GetFigurePath(rectSurface, borderRadius + border))
using (GraphicsPath pathBorder = GetFigurePath(rectBorder, borderRadius))
using (Pen penSurface = new Pen(Parent.BackColor, border))
using (Pen penBorder = new Pen(borderDrawColor, border))
{
penBorder.Alignment = PenAlignment.Outset;
pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
Region = new Region(pathSurface);
pevent.Graphics.DrawPath(penSurface, pathSurface);
pevent.Graphics.DrawPath(penBorder, pathBorder);
}
if (!Enabled && ForeColor != SystemColors.ControlText)
{
var rect = pevent.ClipRectangle;
if (Image is not null)
{
rect.Y += Image.Height;
rect.Height -= Image.Height;
}
TextFormatFlags flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.WordBreak;
TextRenderer.DrawText(pevent.Graphics, Text, Font, rect, Color.Gray, flags);
}
}
}
} }

117
app/UI/RButton.cs Normal file
View File

@@ -0,0 +1,117 @@
using System.Drawing.Drawing2D;
namespace GHelper.UI
{
public class RButton : Button
{
//Fields
private int borderSize = 5;
private int borderRadius = 5;
public int BorderRadius
{
get { return borderRadius; }
set
{
borderRadius = value;
}
}
private Color borderColor = Color.Transparent;
public Color BorderColor
{
get { return borderColor; }
set
{
borderColor = value;
}
}
private bool activated = false;
public bool Activated
{
get { return activated; }
set
{
if (activated != value)
Invalidate();
activated = value;
}
}
private bool secondary = false;
public bool Secondary
{
get { return secondary; }
set
{
secondary = value;
}
}
public RButton()
{
DoubleBuffered = true;
FlatStyle = FlatStyle.Flat;
FlatAppearance.BorderSize = 0;
}
private GraphicsPath GetFigurePath(Rectangle rect, int radius)
{
GraphicsPath path = new GraphicsPath();
float curveSize = radius * 2F;
path.StartFigure();
path.AddArc(rect.X, rect.Y, curveSize, curveSize, 180, 90);
path.AddArc(rect.Right - curveSize, rect.Y, curveSize, curveSize, 270, 90);
path.AddArc(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize, 0, 90);
path.AddArc(rect.X, rect.Bottom - curveSize, curveSize, curveSize, 90, 90);
path.CloseFigure();
return path;
}
protected override void OnPaint(PaintEventArgs pevent)
{
base.OnPaint(pevent);
float ratio = pevent.Graphics.DpiX / 192.0f;
int border = (int)(ratio * borderSize);
Rectangle rectSurface = ClientRectangle;
Rectangle rectBorder = Rectangle.Inflate(rectSurface, -border, -border);
Color borderDrawColor = activated ? borderColor : Color.Transparent;
using (GraphicsPath pathSurface = GetFigurePath(rectSurface, borderRadius + border))
using (GraphicsPath pathBorder = GetFigurePath(rectBorder, borderRadius))
using (Pen penSurface = new Pen(Parent.BackColor, border))
using (Pen penBorder = new Pen(borderDrawColor, border))
{
penBorder.Alignment = PenAlignment.Outset;
pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
Region = new Region(pathSurface);
pevent.Graphics.DrawPath(penSurface, pathSurface);
pevent.Graphics.DrawPath(penBorder, pathBorder);
}
if (!Enabled && ForeColor != SystemColors.ControlText)
{
var rect = pevent.ClipRectangle;
if (Image is not null)
{
rect.Y += Image.Height;
rect.Height -= Image.Height;
}
TextFormatFlags flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.WordBreak;
TextRenderer.DrawText(pevent.Graphics, Text, Font, rect, Color.Gray, flags);
}
}
}
}

7
app/UI/RCheckBox.cs Normal file
View File

@@ -0,0 +1,7 @@
namespace GHelper.UI
{
public class RCheckBox : CheckBox
{
}
}

189
app/UI/RComboBox.cs Normal file
View File

@@ -0,0 +1,189 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
namespace GHelper.UI
{
public class RComboBox : ComboBox
{
private Color borderColor = Color.Gray;
[DefaultValue(typeof(Color), "Gray")]
public Color BorderColor
{
get { return borderColor; }
set
{
if (borderColor != value)
{
borderColor = value;
Invalidate();
}
}
}
private Color buttonColor = Color.FromArgb(255, 255, 255, 255);
[DefaultValue(typeof(Color), "255, 255, 255")]
public Color ButtonColor
{
get { return buttonColor; }
set
{
if (buttonColor != value)
{
buttonColor = value;
Invalidate();
}
}
}
private Color arrowColor = Color.Black;
[DefaultValue(typeof(Color), "Black")]
public Color ArrowColor
{
get { return arrowColor; }
set
{
if (arrowColor != value)
{
arrowColor = value;
Invalidate();
}
}
}
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_PAINT && DropDownStyle != ComboBoxStyle.Simple)
{
var clientRect = ClientRectangle;
var dropDownButtonWidth = SystemInformation.HorizontalScrollBarArrowWidth;
var outerBorder = new Rectangle(clientRect.Location,
new Size(clientRect.Width - 1, clientRect.Height - 1));
var innerBorder = new Rectangle(outerBorder.X + 1, outerBorder.Y + 1,
outerBorder.Width - dropDownButtonWidth - 2, outerBorder.Height - 2);
var innerInnerBorder = new Rectangle(innerBorder.X + 1, innerBorder.Y + 1,
innerBorder.Width - 2, innerBorder.Height - 2);
var dropDownRect = new Rectangle(innerBorder.Right + 1, innerBorder.Y,
dropDownButtonWidth, innerBorder.Height + 1);
if (RightToLeft == RightToLeft.Yes)
{
innerBorder.X = clientRect.Width - innerBorder.Right;
innerInnerBorder.X = clientRect.Width - innerInnerBorder.Right;
dropDownRect.X = clientRect.Width - dropDownRect.Right;
dropDownRect.Width += 1;
}
var innerBorderColor = Enabled ? BackColor : SystemColors.Control;
var outerBorderColor = Enabled ? BorderColor : SystemColors.ControlDark;
var buttonColor = Enabled ? ButtonColor : SystemColors.Control;
var middle = new Point(dropDownRect.Left + dropDownRect.Width / 2,
dropDownRect.Top + dropDownRect.Height / 2);
var arrow = new Point[]
{
new Point(middle.X - 3, middle.Y - 2),
new Point(middle.X + 4, middle.Y - 2),
new Point(middle.X, middle.Y + 2)
};
var ps = new PAINTSTRUCT();
bool shoulEndPaint = false;
nint dc;
if (m.WParam == nint.Zero)
{
dc = BeginPaint(Handle, ref ps);
m.WParam = dc;
shoulEndPaint = true;
}
else
{
dc = m.WParam;
}
var rgn = CreateRectRgn(innerInnerBorder.Left, innerInnerBorder.Top,
innerInnerBorder.Right, innerInnerBorder.Bottom);
SelectClipRgn(dc, rgn);
DefWndProc(ref m);
DeleteObject(rgn);
rgn = CreateRectRgn(clientRect.Left, clientRect.Top,
clientRect.Right, clientRect.Bottom);
SelectClipRgn(dc, rgn);
using (var g = Graphics.FromHdc(dc))
{
using (var b = new SolidBrush(buttonColor))
{
g.FillRectangle(b, dropDownRect);
}
using (var b = new SolidBrush(arrowColor))
{
g.FillPolygon(b, arrow);
}
using (var p = new Pen(innerBorderColor))
{
g.DrawRectangle(p, innerBorder);
g.DrawRectangle(p, innerInnerBorder);
}
using (var p = new Pen(outerBorderColor))
{
g.DrawRectangle(p, outerBorder);
}
}
if (shoulEndPaint)
EndPaint(Handle, ref ps);
DeleteObject(rgn);
}
else
base.WndProc(ref m);
}
private const int WM_PAINT = 0xF;
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public int L, T, R, B;
}
[StructLayout(LayoutKind.Sequential)]
public struct PAINTSTRUCT
{
public nint hdc;
public bool fErase;
public int rcPaint_left;
public int rcPaint_top;
public int rcPaint_right;
public int rcPaint_bottom;
public bool fRestore;
public bool fIncUpdate;
public int reserved1;
public int reserved2;
public int reserved3;
public int reserved4;
public int reserved5;
public int reserved6;
public int reserved7;
public int reserved8;
}
[DllImport("user32.dll")]
private static extern nint BeginPaint(nint hWnd,
[In, Out] ref PAINTSTRUCT lpPaint);
[DllImport("user32.dll")]
private static extern bool EndPaint(nint hWnd, ref PAINTSTRUCT lpPaint);
[DllImport("gdi32.dll")]
public static extern int SelectClipRgn(nint hDC, nint hRgn);
[DllImport("user32.dll")]
public static extern int GetUpdateRgn(nint hwnd, nint hrgn, bool fErase);
public enum RegionFlags
{
ERROR = 0,
NULLREGION = 1,
SIMPLEREGION = 2,
COMPLEXREGION = 3,
}
[DllImport("gdi32.dll")]
internal static extern bool DeleteObject(nint hObject);
[DllImport("gdi32.dll")]
private static extern nint CreateRectRgn(int x1, int y1, int x2, int y2);
}
}

View File

@@ -36,6 +36,7 @@ namespace GHelper.UI
{ {
// This reduces flicker // This reduces flicker
DoubleBuffered = true; DoubleBuffered = true;
TabStop = true;
} }
@@ -89,6 +90,41 @@ namespace GHelper.UI
} }
} }
protected override bool IsInputKey(Keys keyData)
{
switch (keyData)
{
case Keys.Right:
case Keys.Left:
case Keys.Up:
case Keys.Down:
return true;
}
return base.IsInputKey(keyData);
}
protected override void OnKeyDown(KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Right:
case Keys.Up:
Value = Math.Min(Max, Value + Step);
break;
case Keys.Left:
case Keys.Down:
Value = Math.Max(Min, Value - Step);
break;
}
AccessibilityNotifyClients(AccessibleEvents.Focus, 0);
base.OnKeyDown(e);
}
protected override void OnPaint(PaintEventArgs e) protected override void OnPaint(PaintEventArgs e)
{ {
base.OnPaint(e); base.OnPaint(e);
@@ -131,6 +167,8 @@ namespace GHelper.UI
{ {
base.OnMouseDown(e); base.OnMouseDown(e);
Focus();
// Difference between tumb and mouse position. // Difference between tumb and mouse position.
_delta = new SizeF(e.Location.X - _thumbPos.X, e.Location.Y - _thumbPos.Y); _delta = new SizeF(e.Location.X - _thumbPos.X, e.Location.Y - _thumbPos.Y);
if (_delta.Width * _delta.Width + _delta.Height * _delta.Height <= _radius * _radius) if (_delta.Width * _delta.Width + _delta.Height * _delta.Height <= _radius * _radius)

View File

@@ -533,7 +533,7 @@ namespace GHelper.USB
return; return;
} }
if (AppConfig.ContainsModel("GA503")) if (AppConfig.IsNoDirectRGB())
{ {
AsusHid.Write(new List<byte[]> { AuraMessage(AuraMode.AuraStatic, color, color, 0xeb, isSingleColor), MESSAGE_SET }); AsusHid.Write(new List<byte[]> { AuraMessage(AuraMode.AuraStatic, color, color, 0xeb, isSingleColor), MESSAGE_SET });
return; return;
@@ -582,7 +582,7 @@ namespace GHelper.USB
{ {
CustomRGB.ApplyAmbient(true); CustomRGB.ApplyAmbient(true);
timer.Enabled = true; timer.Enabled = true;
timer.Interval = AppConfig.Get("aura_refresh", 120); timer.Interval = AppConfig.Get("aura_refresh", AppConfig.ContainsModel("GU604") ? 400 : 120);
return; return;
} }

View File

@@ -90,6 +90,7 @@ Each BIOS mode is paired with matching Windows Power Mode. You can adjust this s
- ROG Chakram X (P708) - ROG Chakram X (P708)
- ROG Chakram Core (P511) - ROG Chakram Core (P511)
- ROG Strix III Gladius III Aimpoint Wireless (P711) - ROG Strix III Gladius III Aimpoint Wireless (P711)
- ROG Gladius II and Gladius II Origin (P502 and P504)
- ROG Gladius III - ROG Gladius III
- ROG Gladius III Wireless - ROG Gladius III Wireless
- ROG Strix Impact II Wireless - ROG Strix Impact II Wireless