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
|
||||
{
|
||||
@@ -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,6 +168,8 @@ 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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user