Extra icons for OSD

This commit is contained in:
Serge
2023-05-20 22:59:17 +02:00
parent 9f56959c67
commit 9794229f3f
15 changed files with 113 additions and 40 deletions

View File

@@ -21,6 +21,10 @@ namespace GHelper
private void SetKeyCombo(ComboBox combo, TextBox txbox, string name) private void SetKeyCombo(ComboBox combo, TextBox txbox, string name)
{ {
if (name == "m3")
customActions[""] = Properties.Strings.MuteMic;
if (name == "m4") if (name == "m4")
customActions[""] = Properties.Strings.OpenGHelper; customActions[""] = Properties.Strings.OpenGHelper;

View File

@@ -264,7 +264,7 @@ namespace GHelper
var commDevice = enumerator.GetDefaultAudioEndpoint(DataFlow.Capture, Role.Communications); var commDevice = enumerator.GetDefaultAudioEndpoint(DataFlow.Capture, Role.Communications);
bool muteStatus = !commDevice.AudioEndpointVolume.Mute; bool muteStatus = !commDevice.AudioEndpointVolume.Mute;
commDevice.AudioEndpointVolume.Mute = muteStatus; commDevice.AudioEndpointVolume.Mute = muteStatus;
settingsForm.BeginInvoke(settingsForm.RunToast, muteStatus ? "Muted" : "Unmuted", ToastIcon.Microphone); settingsForm.BeginInvoke(settingsForm.RunToast, muteStatus ? "Muted" : "Unmuted", muteStatus ? ToastIcon.MicrophoneMute : ToastIcon.Microphone);
} }
break; break;
@@ -323,25 +323,25 @@ namespace GHelper
brightness = Math.Max(0, brightness - 1); brightness = Math.Max(0, brightness - 1);
config.setConfig("keyboard_brightness", brightness); config.setConfig("keyboard_brightness", brightness);
AsusUSB.ApplyBrightness(brightness); AsusUSB.ApplyBrightness(brightness);
settingsForm.BeginInvoke(settingsForm.RunToast, "Down", ToastIcon.Backlight); settingsForm.BeginInvoke(settingsForm.RunToast, "Backlight", ToastIcon.BacklightDown);
break; break;
case 196: // FN+F3 case 196: // FN+F3
brightness = Math.Min(3, brightness + 1); brightness = Math.Min(3, brightness + 1);
config.setConfig("keyboard_brightness", brightness); config.setConfig("keyboard_brightness", brightness);
AsusUSB.ApplyBrightness(brightness); AsusUSB.ApplyBrightness(brightness);
settingsForm.BeginInvoke(settingsForm.RunToast, "Up", ToastIcon.Backlight); settingsForm.BeginInvoke(settingsForm.RunToast, "Backlight", ToastIcon.BacklightUp);
break; break;
case 16: // FN+F7 case 16: // FN+F7
ScreenBrightness.Adjust(-10); ScreenBrightness.Adjust(-10);
settingsForm.BeginInvoke(settingsForm.RunToast, "Down", ToastIcon.Brightness); settingsForm.BeginInvoke(settingsForm.RunToast, "Brightness", ToastIcon.BrightnessDown);
break; break;
case 32: // FN+F8 case 32: // FN+F8
ScreenBrightness.Adjust(+10); ScreenBrightness.Adjust(+10);
settingsForm.BeginInvoke(settingsForm.RunToast, "Up", ToastIcon.Brightness); settingsForm.BeginInvoke(settingsForm.RunToast, "Brightness", ToastIcon.BrightnessUp);
break; break;
case 107: // FN+F10 case 107: // FN+F10
AsusUSB.TouchpadToggle(); AsusUSB.TouchpadToggle();
settingsForm.BeginInvoke(settingsForm.RunToast, "Toggle", ToastIcon.Touchpad); settingsForm.BeginInvoke(settingsForm.RunToast, "Touchpad", ToastIcon.Touchpad);
break; break;
case 108: // FN+F11 case 108: // FN+F11
Application.SetSuspendState(PowerState.Suspend, true, true); Application.SetSuspendState(PowerState.Suspend, true, true);

View File

@@ -60,6 +60,46 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap backlight_down {
get {
object obj = ResourceManager.GetObject("backlight_down", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap backlight_up {
get {
object obj = ResourceManager.GetObject("backlight_up", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap brightness_down {
get {
object obj = ResourceManager.GetObject("brightness_down", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap brightness_up {
get {
object obj = ResourceManager.GetObject("brightness_up", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary> /// </summary>
@@ -90,16 +130,6 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icons8_brightness_96 {
get {
object obj = ResourceManager.GetObject("icons8_brightness_96", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
@@ -240,6 +270,16 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icons8_mute_unmute_96 {
get {
object obj = ResourceManager.GetObject("icons8_mute_unmute_96", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
@@ -340,16 +380,6 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icons8_sunset_96 {
get {
object obj = ResourceManager.GetObject("icons8_sunset_96", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>

View File

@@ -211,16 +211,25 @@
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="icons8_brightness_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-brightness-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_sunset_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-sunset-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_microphone_96" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="icons8_microphone_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-microphone-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\icons8-microphone-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="icons8_touchpad_96" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="icons8_touchpad_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-touchpad-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\icons8-touchpad-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="backlight_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\backlight-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="backlight_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\backlight-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="brightness_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\brightness-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="brightness_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\brightness-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_mute_unmute_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-mute-unmute-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

View File

@@ -1,6 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
@@ -779,6 +780,15 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Mute Mic.
/// </summary>
internal static string MuteMic {
get {
return ResourceManager.GetString("MuteMic", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Open G-Helper window. /// Looks up a localized string similar to Open G-Helper window.
/// </summary> /// </summary>

View File

@@ -357,6 +357,9 @@
<data name="Multizone" xml:space="preserve"> <data name="Multizone" xml:space="preserve">
<value>Multizone</value> <value>Multizone</value>
</data> </data>
<data name="MuteMic" xml:space="preserve">
<value>Mute Mic</value>
</data>
<data name="OpenGHelper" xml:space="preserve"> <data name="OpenGHelper" xml:space="preserve">
<value>Open G-Helper window</value> <value>Open G-Helper window</value>
</data> </data>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -6,6 +6,7 @@ using System.Net;
using System.Reflection; using System.Reflection;
using System.Text.Json; using System.Text.Json;
using System.Timers; using System.Timers;
using System.Windows.Forms;
using Tools; using Tools;
namespace GHelper namespace GHelper
@@ -272,7 +273,11 @@ namespace GHelper
else else
{ {
Program.acpi.DeviceSet(AsusACPI.GPUXG, 1, "GPU XGM"); Program.acpi.DeviceSet(AsusACPI.GPUXG, 1, "GPU XGM");
if (Program.config.getConfigPerf("auto_apply") == 1)
AsusUSB.SetXGMFan(Program.config.getFanConfig(AsusFan.XGM));
} }
InitXGM(); InitXGM();
} }

View File

@@ -45,10 +45,13 @@ namespace GHelper
public enum ToastIcon public enum ToastIcon
{ {
Brightness, BrightnessUp,
Backlight, BrightnessDown,
BacklightUp,
BacklightDown,
Touchpad, Touchpad,
Microphone Microphone,
MicrophoneMute
} }
public class ToastForm : OSDNativeForm public class ToastForm : OSDNativeForm
@@ -79,15 +82,24 @@ namespace GHelper
switch (toastIcon) switch (toastIcon)
{ {
case ToastIcon.Brightness: case ToastIcon.BrightnessUp:
icon = Properties.Resources.icons8_brightness_96; icon = Properties.Resources.brightness_up;
break; break;
case ToastIcon.Backlight: case ToastIcon.BrightnessDown:
icon = Properties.Resources.icons8_sunset_96; icon = Properties.Resources.brightness_down;
break;
case ToastIcon.BacklightUp:
icon = Properties.Resources.backlight_up;
break;
case ToastIcon.BacklightDown:
icon = Properties.Resources.backlight_down;
break; break;
case ToastIcon.Microphone: case ToastIcon.Microphone:
icon = Properties.Resources.icons8_microphone_96; icon = Properties.Resources.icons8_microphone_96;
break; break;
case ToastIcon.MicrophoneMute:
icon = Properties.Resources.icons8_mute_unmute_96;
break;
case ToastIcon.Touchpad: case ToastIcon.Touchpad:
icon = Properties.Resources.icons8_touchpad_96; icon = Properties.Resources.icons8_touchpad_96;
break; break;
@@ -112,7 +124,7 @@ namespace GHelper
public void RunToast(string text, ToastIcon? icon = null) public void RunToast(string text, ToastIcon? icon = null)
{ {
Hide(); //Hide();
timer.Stop(); timer.Stop();
toastText = text; toastText = text;