Skip to content

Commit

Permalink
Extra icons for OSD
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed May 20, 2023
1 parent 9f56959 commit 9794229
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 40 deletions.
4 changes: 4 additions & 0 deletions app/Extra.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ public partial class Extra : RForm

private void SetKeyCombo(ComboBox combo, TextBox txbox, string name)
{

if (name == "m3")
customActions[""] = Properties.Strings.MuteMic;

if (name == "m4")
customActions[""] = Properties.Strings.OpenGHelper;

Expand Down
12 changes: 6 additions & 6 deletions app/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static void KeyProcess(string name = "m3")
var commDevice = enumerator.GetDefaultAudioEndpoint(DataFlow.Capture, Role.Communications);
bool muteStatus = !commDevice.AudioEndpointVolume.Mute;
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;

Expand Down Expand Up @@ -323,25 +323,25 @@ static void HandleEvent(int EventID)
brightness = Math.Max(0, brightness - 1);
config.setConfig("keyboard_brightness", brightness);
AsusUSB.ApplyBrightness(brightness);
settingsForm.BeginInvoke(settingsForm.RunToast, "Down", ToastIcon.Backlight);
settingsForm.BeginInvoke(settingsForm.RunToast, "Backlight", ToastIcon.BacklightDown);
break;
case 196: // FN+F3
brightness = Math.Min(3, brightness + 1);
config.setConfig("keyboard_brightness", brightness);
AsusUSB.ApplyBrightness(brightness);
settingsForm.BeginInvoke(settingsForm.RunToast, "Up", ToastIcon.Backlight);
settingsForm.BeginInvoke(settingsForm.RunToast, "Backlight", ToastIcon.BacklightUp);
break;
case 16: // FN+F7
ScreenBrightness.Adjust(-10);
settingsForm.BeginInvoke(settingsForm.RunToast, "Down", ToastIcon.Brightness);
settingsForm.BeginInvoke(settingsForm.RunToast, "Brightness", ToastIcon.BrightnessDown);
break;
case 32: // FN+F8
ScreenBrightness.Adjust(+10);
settingsForm.BeginInvoke(settingsForm.RunToast, "Up", ToastIcon.Brightness);
settingsForm.BeginInvoke(settingsForm.RunToast, "Brightness", ToastIcon.BrightnessUp);
break;
case 107: // FN+F10
AsusUSB.TouchpadToggle();
settingsForm.BeginInvoke(settingsForm.RunToast, "Toggle", ToastIcon.Touchpad);
settingsForm.BeginInvoke(settingsForm.RunToast, "Touchpad", ToastIcon.Touchpad);
break;
case 108: // FN+F11
Application.SetSuspendState(PowerState.Suspend, true, true);
Expand Down
70 changes: 50 additions & 20 deletions app/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 15 additions & 6 deletions app/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,25 @@
<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>
</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">
<value>..\Resources\icons8-microphone-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<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>
</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>
10 changes: 10 additions & 0 deletions app/Properties/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions app/Properties/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@
<data name="Multizone" xml:space="preserve">
<value>Multizone</value>
</data>
<data name="MuteMic" xml:space="preserve">
<value>Mute Mic</value>
</data>
<data name="OpenGHelper" xml:space="preserve">
<value>Open G-Helper window</value>
</data>
Expand Down
Binary file added app/Resources/backlight-down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/Resources/backlight-up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/Resources/brightness-down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/Resources/brightness-up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/Resources/icons8-brightness-96.png
Binary file not shown.
Binary file added app/Resources/icons8-mute-unmute-96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/Resources/icons8-sunset-96.png
Binary file not shown.
5 changes: 5 additions & 0 deletions app/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Reflection;
using System.Text.Json;
using System.Timers;
using System.Windows.Forms;
using Tools;

namespace GHelper
Expand Down Expand Up @@ -272,7 +273,11 @@ private void ButtonXGM_Click(object? sender, EventArgs e)
else
{
Program.acpi.DeviceSet(AsusACPI.GPUXG, 1, "GPU XGM");

if (Program.config.getConfigPerf("auto_apply") == 1)
AsusUSB.SetXGMFan(Program.config.getFanConfig(AsusFan.XGM));
}

InitXGM();
}

Expand Down
28 changes: 20 additions & 8 deletions app/ToastForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ public static void FillRoundedRectangle(this Graphics graphics, Brush brush, Rec

public enum ToastIcon
{
Brightness,
Backlight,
BrightnessUp,
BrightnessDown,
BacklightUp,
BacklightDown,
Touchpad,
Microphone
Microphone,
MicrophoneMute
}

public class ToastForm : OSDNativeForm
Expand Down Expand Up @@ -79,15 +82,24 @@ protected override void PerformPaint(PaintEventArgs e)

switch (toastIcon)
{
case ToastIcon.Brightness:
icon = Properties.Resources.icons8_brightness_96;
case ToastIcon.BrightnessUp:
icon = Properties.Resources.brightness_up;
break;
case ToastIcon.Backlight:
icon = Properties.Resources.icons8_sunset_96;
case ToastIcon.BrightnessDown:
icon = Properties.Resources.brightness_down;
break;
case ToastIcon.BacklightUp:
icon = Properties.Resources.backlight_up;
break;
case ToastIcon.BacklightDown:
icon = Properties.Resources.backlight_down;
break;
case ToastIcon.Microphone:
icon = Properties.Resources.icons8_microphone_96;
break;
case ToastIcon.MicrophoneMute:
icon = Properties.Resources.icons8_mute_unmute_96;
break;
case ToastIcon.Touchpad:
icon = Properties.Resources.icons8_touchpad_96;
break;
Expand All @@ -112,7 +124,7 @@ protected override void PerformPaint(PaintEventArgs e)

public void RunToast(string text, ToastIcon? icon = null)
{
Hide();
//Hide();
timer.Stop();

toastText = text;
Expand Down

0 comments on commit 9794229

Please sign in to comment.