mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dca954a244 | ||
|
|
440632c209 | ||
|
|
274c2ef706 | ||
|
|
acb7a45139 | ||
|
|
9d5c70b4c3 | ||
|
|
cc682412cc | ||
|
|
ee89a2308b | ||
|
|
1578c7a18e | ||
|
|
b50f4f11a4 | ||
|
|
ad5b3e33c4 | ||
|
|
5de44067bc | ||
|
|
82f76b8d80 | ||
|
|
0823e8efa2 | ||
|
|
7bd0d3594a | ||
|
|
573b56f6b6 | ||
|
|
aabead161a | ||
|
|
5602d385f6 | ||
|
|
537123acda |
@@ -395,7 +395,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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -435,11 +435,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"));
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
public void SetAPUMem(int memory = 4)
|
public void SetAPUMem(int memory = 4)
|
||||||
{
|
{
|
||||||
if (memory < 0 || memory > 8) return;
|
if (memory < 0 || memory > 8) return;
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
20
app/Extra.Designer.cs
generated
20
app/Extra.Designer.cs
generated
@@ -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;
|
||||||
|
|||||||
30
app/Extra.cs
30
app/Extra.cs
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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.144</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
18
app/Properties/Strings.Designer.cs
generated
18
app/Properties/Strings.Designer.cs
generated
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
25
app/Settings.Designer.cs
generated
25
app/Settings.Designer.cs
generated
@@ -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;
|
||||||
|
|||||||
180
app/Settings.cs
180
app/Settings.cs
@@ -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";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
117
app/UI/RButton.cs
Normal 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
7
app/UI/RCheckBox.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace GHelper.UI
|
||||||
|
{
|
||||||
|
public class RCheckBox : CheckBox
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
189
app/UI/RComboBox.cs
Normal file
189
app/UI/RComboBox.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user