mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
UI Tweaks
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System.Drawing.Drawing2D;
|
using System.Diagnostics;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
|
||||||
namespace GHelper.Helpers
|
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)
|
public void RunToast(string text, ToastIcon? icon = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -157,9 +168,11 @@ namespace GHelper.Helpers
|
|||||||
Show();
|
Show();
|
||||||
timer.Start();
|
timer.Start();
|
||||||
|
|
||||||
|
//if (AppConfig.Is("narrator")) ReadText(text);
|
||||||
|
|
||||||
Program.settingsForm.AccessibilityObject.RaiseAutomationNotification(
|
Program.settingsForm.AccessibilityObject.RaiseAutomationNotification(
|
||||||
System.Windows.Forms.Automation.AutomationNotificationKind.ActionCompleted,
|
System.Windows.Forms.Automation.AutomationNotificationKind.ActionCompleted,
|
||||||
System.Windows.Forms.Automation.AutomationNotificationProcessing.MostRecent,
|
System.Windows.Forms.Automation.AutomationNotificationProcessing.MostRecent,
|
||||||
text);
|
text);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1382,13 +1382,13 @@ namespace GHelper
|
|||||||
buttonEco.Activated = !GPUAuto;
|
buttonEco.Activated = !GPUAuto;
|
||||||
buttonOptimized.Activated = GPUAuto;
|
buttonOptimized.Activated = GPUAuto;
|
||||||
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeEco;
|
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;
|
Program.trayIcon.Icon = Properties.Resources.eco;
|
||||||
break;
|
break;
|
||||||
case AsusACPI.GPUModeUltimate:
|
case AsusACPI.GPUModeUltimate:
|
||||||
buttonUltimate.Activated = true;
|
buttonUltimate.Activated = true;
|
||||||
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeUltimate;
|
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;
|
Program.trayIcon.Icon = Properties.Resources.ultimate;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -1396,7 +1396,7 @@ namespace GHelper
|
|||||||
buttonStandard.Activated = !GPUAuto;
|
buttonStandard.Activated = !GPUAuto;
|
||||||
buttonOptimized.Activated = GPUAuto;
|
buttonOptimized.Activated = GPUAuto;
|
||||||
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeStandard;
|
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;
|
Program.trayIcon.Icon = Properties.Resources.standard;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,17 @@ namespace GHelper.UI
|
|||||||
{
|
{
|
||||||
public class RButton : Button
|
public class RButton : Button
|
||||||
{
|
{
|
||||||
|
|
||||||
|
protected override CreateParams CreateParams
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var parms = base.CreateParams;
|
||||||
|
parms.Style &= ~0x02000000; // Turn off WS_CLIPCHILDREN
|
||||||
|
return parms;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Fields
|
//Fields
|
||||||
private int borderSize = 5;
|
private int borderSize = 5;
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,16 @@ namespace GHelper.UI
|
|||||||
|
|
||||||
public bool darkTheme = false;
|
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)
|
public static void InitColors(bool darkTheme)
|
||||||
{
|
{
|
||||||
if (darkTheme)
|
if (darkTheme)
|
||||||
@@ -98,8 +108,10 @@ namespace GHelper.UI
|
|||||||
{
|
{
|
||||||
DwmSetWindowAttribute(Handle, 20, new[] { darkTheme ? 1 : 0 }, 4);
|
DwmSetWindowAttribute(Handle, 20, new[] { darkTheme ? 1 : 0 }, 4);
|
||||||
ControlHelper.Adjust(this, changed);
|
ControlHelper.Adjust(this, changed);
|
||||||
|
this.Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user