From b8c8508fd755855ba79fdafa0f0c35f5a441506c Mon Sep 17 00:00:00 2001
From: Serge <5920850+seerge@users.noreply.github.com>
Date: Tue, 6 Feb 2024 15:23:56 +0100
Subject: [PATCH 1/7] Narrator improvements
https://github.com/seerge/g-helper/issues/2035
---
app/Settings.cs | 5 +++++
app/Updates.Designer.cs | 2 +-
app/Updates.cs | 26 ++++++++++++++++++++------
3 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/app/Settings.cs b/app/Settings.cs
index 2723a759..b9e5f654 100644
--- a/app/Settings.cs
+++ b/app/Settings.cs
@@ -1382,11 +1382,13 @@ namespace GHelper
buttonEco.Activated = !GPUAuto;
buttonOptimized.Activated = GPUAuto;
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeEco;
+ panelGPU.AccessibleName = Properties.Strings.GPUMode + ": " + (GPUAuto ? Properties.Strings.Optimized : Properties.Strings.EcoMode);
Program.trayIcon.Icon = Properties.Resources.eco;
break;
case AsusACPI.GPUModeUltimate:
buttonUltimate.Activated = true;
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeUltimate;
+ panelGPU.AccessibleName = Properties.Strings.GPUMode + ": " + Properties.Strings.UltimateMode;
Program.trayIcon.Icon = Properties.Resources.ultimate;
break;
default:
@@ -1394,10 +1396,13 @@ namespace GHelper
buttonStandard.Activated = !GPUAuto;
buttonOptimized.Activated = GPUAuto;
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeStandard;
+ panelGPU.AccessibleName = Properties.Strings.GPUMode + ": " + (GPUAuto ? Properties.Strings.Optimized : Properties.Strings.StandardMode);
Program.trayIcon.Icon = Properties.Resources.standard;
break;
}
+
+
VisualizeXGM(GPUMode);
if (isGpuSection)
diff --git a/app/Updates.Designer.cs b/app/Updates.Designer.cs
index 8feb65b4..d72c08f5 100644
--- a/app/Updates.Designer.cs
+++ b/app/Updates.Designer.cs
@@ -126,7 +126,7 @@ namespace GHelper
buttonRefresh.Name = "buttonRefresh";
buttonRefresh.Secondary = true;
buttonRefresh.Size = new Size(52, 46);
- buttonRefresh.TabIndex = 3;
+ buttonRefresh.TabIndex = 1;
buttonRefresh.UseVisualStyleBackColor = false;
//
// panelBios
diff --git a/app/Updates.cs b/app/Updates.cs
index 7de7b532..428466e6 100644
--- a/app/Updates.cs
+++ b/app/Updates.cs
@@ -35,10 +35,15 @@ namespace GHelper
(bios, model) = AppConfig.GetBiosAndModel();
+ buttonRefresh.TabStop = false;
+
updatesCount = 0;
labelUpdates.ForeColor = colorEco;
labelUpdates.Text = Properties.Strings.NoNewUpdates;
+ panelBios.AccessibleRole = AccessibleRole.Grouping;
+ panelBios.AccessibleName = Properties.Strings.NoNewUpdates;
+ panelBios.TabStop = true;
Text = Properties.Strings.BiosAndDriverUpdates + ": " + model + " " + bios;
labelBIOS.Text = "BIOS";
@@ -121,12 +126,17 @@ namespace GHelper
Invoke(delegate
{
string versionText = driver.version.Replace("latest version at the ", "");
- Label versionLabel = new Label { Text = versionText, Anchor = AnchorStyles.Left, AutoSize = true };
+ LinkLabel versionLabel = new LinkLabel { Text = versionText, Anchor = AnchorStyles.Left, AutoSize = true };
+
+ versionLabel.AccessibleName = driver.title;
+ versionLabel.TabStop = true;
+ versionLabel.TabIndex = table.RowCount + 1;
+
versionLabel.Cursor = Cursors.Hand;
versionLabel.Font = new Font(versionLabel.Font, FontStyle.Underline);
- versionLabel.ForeColor = colorEco;
+ versionLabel.LinkColor = colorEco;
versionLabel.Padding = new Padding(5, 5, 5, 5);
- versionLabel.Click += delegate
+ versionLabel.LinkClicked += delegate
{
Process.Start(new ProcessStartInfo(driver.downloadUrl) { UseShellExecute = true });
};
@@ -152,18 +162,19 @@ namespace GHelper
public void VisualiseNewDriver(int position, int newer, TableLayoutPanel table)
{
- var label = table.GetControlFromPosition(3, position) as Label;
+ var label = table.GetControlFromPosition(3, position) as LinkLabel;
if (label != null)
{
Invoke(delegate
{
if (newer == DRIVER_NEWER)
{
+ label.AccessibleName = label.AccessibleName + Properties.Strings.NewUpdates;
label.Font = new Font(label.Font, FontStyle.Underline | FontStyle.Bold);
- label.ForeColor = colorTurbo;
+ label.LinkColor = colorTurbo;
}
- if (newer == DRIVER_NOT_FOUND) label.ForeColor = Color.Gray;
+ if (newer == DRIVER_NOT_FOUND) label.LinkColor = Color.Gray;
});
}
@@ -176,6 +187,9 @@ namespace GHelper
labelUpdates.Text = $"{Properties.Strings.NewUpdates}: {updatesCount}";
labelUpdates.ForeColor = colorTurbo;
labelUpdates.Font = new Font(labelUpdates.Font, FontStyle.Bold);
+
+ panelBios.AccessibleName = labelUpdates.Text;
+
});
}
From 5875c1ed2c8673f5034aaf10c4ae6133210e0dd7 Mon Sep 17 00:00:00 2001
From: Serge <5920850+seerge@users.noreply.github.com>
Date: Tue, 6 Feb 2024 18:21:26 +0100
Subject: [PATCH 2/7] Narrator support for toast notifications
https://github.com/seerge/g-helper/issues/2035
---
app/Helpers/ToastForm.cs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/app/Helpers/ToastForm.cs b/app/Helpers/ToastForm.cs
index a96cc509..6e8a449f 100644
--- a/app/Helpers/ToastForm.cs
+++ b/app/Helpers/ToastForm.cs
@@ -156,6 +156,12 @@ namespace GHelper.Helpers
Show();
timer.Start();
+
+ Program.settingsForm.AccessibilityObject.RaiseAutomationNotification(
+ System.Windows.Forms.Automation.AutomationNotificationKind.ActionCompleted,
+ System.Windows.Forms.Automation.AutomationNotificationProcessing.MostRecent,
+ text);
+
});
}
From b825b0dcd485780c19eb8e16e1fd36ac4c47705e Mon Sep 17 00:00:00 2001
From: Serge <5920850+seerge@users.noreply.github.com>
Date: Wed, 7 Feb 2024 11:54:16 +0100
Subject: [PATCH 3/7] New translations strings.resx (French) (#2037)
---
app/Properties/Strings.fr.resx | 48 +++++++++++++++++-----------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/app/Properties/Strings.fr.resx b/app/Properties/Strings.fr.resx
index 18ac0b45..c5e50613 100644
--- a/app/Properties/Strings.fr.resx
+++ b/app/Properties/Strings.fr.resx
@@ -145,7 +145,7 @@
Redémarrer maintenant ?
- Ally Controller
+ Contrôleur Ally
Vitesse de l'animation
@@ -253,10 +253,10 @@
Délai branché / sur batterie (0 - ON)
- Backlight Timeout when on battery
+ Délai de rétro-éclairage sur batterie
- Backlight Timeout when plugged
+ Délai de rétro-éclairage sur secteur
Équilibré
@@ -274,13 +274,13 @@
Charge unique à 100%
- Binding
+ Liaison
- Primary
+ Primaire
- Secondary
+ Secondaire
Mise à jour BIOS et pilotes
@@ -310,10 +310,10 @@
Couleur
- Contrast
+ Contraste
- Controller
+ Contrôleur
CPU Boost
@@ -328,7 +328,7 @@
Par défaut
- Disable Controller
+ Désactiver le contrôleur
Désactiver l'overdrive de l'écran
@@ -349,7 +349,7 @@
Éco
- Enable GPU on shutdown (prevents issue with Eco mode)
+ Activer le GPU lors de l'arrêt (empêche les problèmes avec le mode Éco)
Désactiver le dGPU en passant au mode Eco pendant que le mode d'affichage dans le panneau de configuration NVIDIA n'est pas réglé sur Optimus peut causer des problèmes avec les commandes de luminosité jusqu'au prochain redémarrage.
@@ -363,7 +363,7 @@ Voulez-vous continuer ?
Paramètres d'énergie
- Export Profile
+ Exporter un profil
+ d'options
@@ -438,10 +438,10 @@ Voulez-vous continuer ?
Élevé
- Image Rotation
+ Rotation de l'image
- Import Profile
+ Importer un profil
Raccourcis clavier
@@ -477,10 +477,10 @@ Voulez-vous continuer ?
Faible
- Left Stick Deadzones
+ Stick gauche des zones mortes
- Left Trigger Deadzones
+ Gâchette gauche des zones mortes
Visualiseur Audio
@@ -528,10 +528,10 @@ Voulez-vous continuer ?
Arrêt automatique après
- Button Response
+ Réponse du bouton
- Import failed. Selected file is not a valid mouse profile or corrutpted.
+ Échec de l'importation. Le fichier sélectionné n'est pas un profil de souris valide ou corrompu.
Lift Off Distance
@@ -567,7 +567,7 @@ Voulez-vous continuer ?
Non connecté
- One Zone
+ Une zone
Ouvrir G-Helper
@@ -600,7 +600,7 @@ Voulez-vous continuer ?
Lecture / Pause
- Polling Rate
+ Fréquence d'interrogation
Limites de puissance
@@ -618,7 +618,7 @@ Voulez-vous continuer ?
Quitter
- Reset
+ Réinitialiser
Un programme utilise le dGPU et empêche le passage en mode Éco. Laissez G-Helper tenter un redémarrage du dGPU dans le gestionnaire de tâches ? (Procéder à vos propres risques)
@@ -627,16 +627,16 @@ Voulez-vous continuer ?
RPM
- Right Stick Deadzones
+ Stick droit des zones mortes
- Right Trigger Deadzones
+ Gâchette droite des zones mortes
Exécuter au démarrage
- Scaling Quality
+ Qualité de Mise à l'échelle (Scaling)
Baisser la luminosité du Screenpad
@@ -717,7 +717,7 @@ Voulez-vous continuer ?
Version
- Vibration Strength
+ Intensité de la vibration
Vol-
From b879a4f83fb8a8439b8d90bec04e572b2e2d468e Mon Sep 17 00:00:00 2001
From: Serge <5920850+seerge@users.noreply.github.com>
Date: Wed, 7 Feb 2024 12:40:30 +0100
Subject: [PATCH 4/7] UI Tweaks
---
app/Helpers/ToastForm.cs | 19 ++++++++++++++++---
app/Settings.cs | 6 +++---
app/UI/RButton.cs | 11 +++++++++++
app/UI/RForm.cs | 12 ++++++++++++
4 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/app/Helpers/ToastForm.cs b/app/Helpers/ToastForm.cs
index 6e8a449f..e6d298e9 100644
--- a/app/Helpers/ToastForm.cs
+++ b/app/Helpers/ToastForm.cs
@@ -1,4 +1,5 @@
-using System.Drawing.Drawing2D;
+using System.Diagnostics;
+using System.Drawing.Drawing2D;
namespace GHelper.Helpers
{
@@ -134,6 +135,16 @@ namespace GHelper.Helpers
}
+ public static void ReadText(string text)
+ {
+ ProcessStartInfo startInfo = new ProcessStartInfo();
+ startInfo.FileName = "PowerShell.exe";
+ startInfo.Arguments = $"-Command \"Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak('{text}')\"";
+ startInfo.CreateNoWindow = true;
+ Process.Start(startInfo);
+ }
+
+
public void RunToast(string text, ToastIcon? icon = null)
{
@@ -157,9 +168,11 @@ namespace GHelper.Helpers
Show();
timer.Start();
+ //if (AppConfig.Is("narrator")) ReadText(text);
+
Program.settingsForm.AccessibilityObject.RaiseAutomationNotification(
- System.Windows.Forms.Automation.AutomationNotificationKind.ActionCompleted,
- System.Windows.Forms.Automation.AutomationNotificationProcessing.MostRecent,
+ System.Windows.Forms.Automation.AutomationNotificationKind.ActionCompleted,
+ System.Windows.Forms.Automation.AutomationNotificationProcessing.MostRecent,
text);
});
diff --git a/app/Settings.cs b/app/Settings.cs
index b9e5f654..bbaec21c 100644
--- a/app/Settings.cs
+++ b/app/Settings.cs
@@ -1382,13 +1382,13 @@ namespace GHelper
buttonEco.Activated = !GPUAuto;
buttonOptimized.Activated = GPUAuto;
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeEco;
- panelGPU.AccessibleName = Properties.Strings.GPUMode + ": " + (GPUAuto ? Properties.Strings.Optimized : Properties.Strings.EcoMode);
+ panelGPU.AccessibleName = Properties.Strings.GPUMode + " - " + (GPUAuto ? Properties.Strings.Optimized : Properties.Strings.EcoMode);
Program.trayIcon.Icon = Properties.Resources.eco;
break;
case AsusACPI.GPUModeUltimate:
buttonUltimate.Activated = true;
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeUltimate;
- panelGPU.AccessibleName = Properties.Strings.GPUMode + ": " + Properties.Strings.UltimateMode;
+ panelGPU.AccessibleName = Properties.Strings.GPUMode + " - " + Properties.Strings.UltimateMode;
Program.trayIcon.Icon = Properties.Resources.ultimate;
break;
default:
@@ -1396,7 +1396,7 @@ namespace GHelper
buttonStandard.Activated = !GPUAuto;
buttonOptimized.Activated = GPUAuto;
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeStandard;
- panelGPU.AccessibleName = Properties.Strings.GPUMode + ": " + (GPUAuto ? Properties.Strings.Optimized : Properties.Strings.StandardMode);
+ panelGPU.AccessibleName = Properties.Strings.GPUMode + " - " + (GPUAuto ? Properties.Strings.Optimized : Properties.Strings.StandardMode);
Program.trayIcon.Icon = Properties.Resources.standard;
break;
}
diff --git a/app/UI/RButton.cs b/app/UI/RButton.cs
index d2b93d36..e6cd81fe 100644
--- a/app/UI/RButton.cs
+++ b/app/UI/RButton.cs
@@ -4,6 +4,17 @@ namespace GHelper.UI
{
public class RButton : Button
{
+
+ protected override CreateParams CreateParams
+ {
+ get
+ {
+ var parms = base.CreateParams;
+ parms.Style &= ~0x02000000; // Turn off WS_CLIPCHILDREN
+ return parms;
+ }
+ }
+
//Fields
private int borderSize = 5;
diff --git a/app/UI/RForm.cs b/app/UI/RForm.cs
index 003f2937..dc28e83b 100644
--- a/app/UI/RForm.cs
+++ b/app/UI/RForm.cs
@@ -29,6 +29,16 @@ namespace GHelper.UI
public bool darkTheme = false;
+ protected override CreateParams CreateParams
+ {
+ get
+ {
+ CreateParams cp = base.CreateParams;
+ cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
+ return cp;
+ }
+ }
+
public static void InitColors(bool darkTheme)
{
if (darkTheme)
@@ -98,8 +108,10 @@ namespace GHelper.UI
{
DwmSetWindowAttribute(Handle, 20, new[] { darkTheme ? 1 : 0 }, 4);
ControlHelper.Adjust(this, changed);
+ this.Invalidate();
}
+
return changed;
}
From e5e079896ddee7de0603a2a2915e8fc25a41a346 Mon Sep 17 00:00:00 2001
From: Serge <5920850+seerge@users.noreply.github.com>
Date: Wed, 7 Feb 2024 12:51:58 +0100
Subject: [PATCH 5/7] UI tweaks
---
app/Settings.cs | 9 +++++++++
app/UI/RButton.cs | 10 ----------
app/UI/RForm.cs | 10 ----------
3 files changed, 9 insertions(+), 20 deletions(-)
diff --git a/app/Settings.cs b/app/Settings.cs
index bbaec21c..f3fe0d94 100644
--- a/app/Settings.cs
+++ b/app/Settings.cs
@@ -47,6 +47,15 @@ namespace GHelper
bool batteryMouseOver = false;
bool batteryFullMouseOver = false;
+ protected override CreateParams CreateParams
+ {
+ get
+ {
+ CreateParams cp = base.CreateParams;
+ cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
+ return cp;
+ }
+ }
public SettingsForm()
{
diff --git a/app/UI/RButton.cs b/app/UI/RButton.cs
index e6cd81fe..7284f8d0 100644
--- a/app/UI/RButton.cs
+++ b/app/UI/RButton.cs
@@ -5,16 +5,6 @@ namespace GHelper.UI
public class RButton : Button
{
- protected override CreateParams CreateParams
- {
- get
- {
- var parms = base.CreateParams;
- parms.Style &= ~0x02000000; // Turn off WS_CLIPCHILDREN
- return parms;
- }
- }
-
//Fields
private int borderSize = 5;
diff --git a/app/UI/RForm.cs b/app/UI/RForm.cs
index dc28e83b..804d6c6a 100644
--- a/app/UI/RForm.cs
+++ b/app/UI/RForm.cs
@@ -29,16 +29,6 @@ namespace GHelper.UI
public bool darkTheme = false;
- protected override CreateParams CreateParams
- {
- get
- {
- CreateParams cp = base.CreateParams;
- cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
- return cp;
- }
- }
-
public static void InitColors(bool darkTheme)
{
if (darkTheme)
From c4e251afa0793313907b5e68a94af852681dfb79 Mon Sep 17 00:00:00 2001
From: Serge <5920850+seerge@users.noreply.github.com>
Date: Wed, 7 Feb 2024 13:09:59 +0100
Subject: [PATCH 6/7] UI Tweaks
---
app/Settings.cs | 9 ---------
app/UI/RForm.cs | 10 +++++++++-
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/app/Settings.cs b/app/Settings.cs
index f3fe0d94..bbaec21c 100644
--- a/app/Settings.cs
+++ b/app/Settings.cs
@@ -47,15 +47,6 @@ namespace GHelper
bool batteryMouseOver = false;
bool batteryFullMouseOver = false;
- protected override CreateParams CreateParams
- {
- get
- {
- CreateParams cp = base.CreateParams;
- cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
- return cp;
- }
- }
public SettingsForm()
{
diff --git a/app/UI/RForm.cs b/app/UI/RForm.cs
index 804d6c6a..2f203e01 100644
--- a/app/UI/RForm.cs
+++ b/app/UI/RForm.cs
@@ -28,7 +28,15 @@ namespace GHelper.UI
private static extern int DwmSetWindowAttribute(nint hwnd, int attr, int[] attrValue, int attrSize);
public bool darkTheme = false;
-
+ protected override CreateParams CreateParams
+ {
+ get
+ {
+ var parms = base.CreateParams;
+ parms.Style &= ~0x02000000; // Turn off WS_CLIPCHILDREN
+ return parms;
+ }
+ }
public static void InitColors(bool darkTheme)
{
if (darkTheme)
From af001b056a44a20bf1c598ec88aa9a9e37eaedd3 Mon Sep 17 00:00:00 2001
From: Serge <5920850+seerge@users.noreply.github.com>
Date: Wed, 7 Feb 2024 21:22:12 +0100
Subject: [PATCH 7/7] UI Fixes
---
app/Program.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/Program.cs b/app/Program.cs
index c315888b..ecf1d2e7 100644
--- a/app/Program.cs
+++ b/app/Program.cs
@@ -266,7 +266,7 @@ namespace GHelper
{
// If helper window is not on top, this just focuses on the app again
// Pressing the ghelper button again will hide the app
- if (checkForFocus && !settingsForm.HasAnyFocus(trayClick))
+ if (checkForFocus && !settingsForm.HasAnyFocus(trayClick) && !AppConfig.Is("topmost"))
{
settingsForm.ShowAll();
}