Only show battery percentage when the mouse has a battery.

This commit is contained in:
IceStormNG
2023-09-25 14:31:23 +02:00
parent cd95802912
commit 82f5afa278

View File

@@ -1135,11 +1135,19 @@ namespace GHelper
Button b = buttons[i]; Button b = buttons[i];
if (m.IsDeviceReady) if (m.IsDeviceReady)
{
if (m.HasBattery())
{ {
b.Text = m.GetDisplayName() + "\n" + m.Battery + "%" b.Text = m.GetDisplayName() + "\n" + m.Battery + "%"
+ (m.Charging ? "(" + Properties.Strings.Charging + ")" : ""); + (m.Charging ? "(" + Properties.Strings.Charging + ")" : "");
} }
else else
{
b.Text = m.GetDisplayName();
}
}
else
{ {
//Mouse is either not connected or in standby //Mouse is either not connected or in standby
b.Text = m.GetDisplayName() + "\n(" + Properties.Strings.NotConnected + ")"; b.Text = m.GetDisplayName() + "\n(" + Properties.Strings.NotConnected + ")";