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

@@ -1136,8 +1136,16 @@ namespace GHelper
if (m.IsDeviceReady)
{
b.Text = m.GetDisplayName() + "\n" + m.Battery + "%"
+ (m.Charging ? "(" + Properties.Strings.Charging + ")" : "");
if (m.HasBattery())
{
b.Text = m.GetDisplayName() + "\n" + m.Battery + "%"
+ (m.Charging ? "(" + Properties.Strings.Charging + ")" : "");
}
else
{
b.Text = m.GetDisplayName();
}
}
else
{