Repository: pwr-Solaar/Solaar

Issue:
UX: "next 50%" is not clear
I have a M720 and see this:
![grafik](https://user-images.githubusercontent.com/11966684/90924746-4f480e80-e3f0-11ea-8cc6-2a6840c3a028.png)

So the battery icon is not clear to me at all.
90% of course is self-explaining, but what does the small "(next 50%)" mean??

(image copied from libratbag, https://github.com/libratbag/libratbag/issues/1046)


Discussion:
It's the next battery level that will be reported.
"next" by itself was used to conserve space, which was much more important before the new settings were added.

Suggestions for short but informative replacements are welcome.
Ahh, because it is a standard battery I guess, the mouse cannot report more than, I guess, 0%, 50% and 90% ?
If so, then maybe name it "next report at 50%". I mean, after all, you do have enough horizontal space (to the right) there, so there is no need to be spare there.
Yes, now there is more space because there are more settings.  The string was selected when this line was likely to be the longest.  
Something like "next report" is not going to be the longest line any more for many devices.  However, a full sentence is probably not needeed. I favour something that includes "level", maybe just "next level" along with changing "Battery" to "Battery Level".
> maybe just "next level" along with changing "Battery" to "Battery Level".

Id you'd do this, that would be essentially information _duplication_. Also the icon and the fact that it is about battery make it very clear that it is a level (after all, it's pretty obvious you won't see watt-hours there :upside_down_face:).
That's why I'd mention "report" or some other keyword that highlights that the data will get "refreshed" at the given percentage there…
On the left, "Battery Level" is okay, given you have enough space there, too.
Except that the report levels are from the device to Solaar.  Solaar reports to the user much more often than the battery levels change.  So which report is being referred to?
But maybe "Battery Level" and "next reported" would be generally understandable.
Yeah, agree with your last sentence. It is written directly next to the battery level, so one can easily understand it as the "next reported battery level". And that's what it is. :blush: 
Maybe you could also add a tooltip that explains the next level briefly.

Resolving patch:
diff --git a/lib/solaar/ui/window.py b/lib/solaar/ui/window.py
--- a/lib/solaar/ui/window.py
+++ b/lib/solaar/ui/window.py
@@ -658,10 +658,12 @@ def _update_device_panel(device, panel, buttons, full=False):
 
     if battery_level is None:
         icon_name = _icons.battery()
-        panel._battery._icon.set_sensitive(False)
         panel._battery._icon.set_from_icon_name(icon_name, _INFO_ICON_SIZE)
-        panel._battery._text.set_sensitive(True)
+        panel._battery._icon.set_sensitive(False)
+        panel._battery._text.set_sensitive(is_online)
+        panel._battery._label.set_text(_('Battery'))
         panel._battery._text.set_markup('<small>%s</small>' % _('unknown'))
+        panel._battery.set_tooltip_text(_('Battery information unknown.'))
     else:
         charging = device.status.get(_K.BATTERY_CHARGING)
         icon_name = _icons.battery(battery_level, charging)
@@ -669,16 +671,23 @@ def _update_device_panel(device, panel, buttons, full=False):
         panel._battery._icon.set_sensitive(True)
 
         if battery_voltage is not None:
+            panel._battery._label.set_text(_('Battery Voltage'))
             text = '%(battery_voltage)dmV' % {'battery_voltage': battery_voltage}
+            tooltip_text = _('Voltage reported by battery')
         elif isinstance(battery_level, _NamedInt):
+            panel._battery._label.set_text(_('Battery Level'))
             text = _(str(battery_level))
+            tooltip_text = _('Approximate level reported by battery')
         else:
+            panel._battery._label.set_text(_('Battery Level'))
             text = '%(battery_percent)d%%' % {'battery_percent': battery_level}
+            tooltip_text = _('Approximate level reported by battery')
         if battery_next_level is not None:
             if isinstance(battery_next_level, _NamedInt):
-                text += '<small> (' + _('next ') + _(str(battery_next_level)) + ')</small>'
+                text += '<small> (' + _('next reported ') + _(str(battery_next_level)) + ')</small>'
             else:
-                text += '<small> (' + _('next ') + ('%d%%' % battery_next_level) + ')</small>'
+                text += '<small> (' + _('next reported ') + ('%d%%' % battery_next_level) + ')</small>'
+            tooltip_text = tooltip_text + _(' and next level to be reported.')
         if is_online:
             if charging:
                 text += ' <small>(%s)</small>' % _('charging')
@@ -686,6 +695,7 @@ def _update_device_panel(device, panel, buttons, full=False):
             text += ' <small>(%s)</small>' % _('last known')
         panel._battery._text.set_sensitive(is_online)
         panel._battery._text.set_markup(text)
+        panel._battery.set_tooltip_text(tooltip_text)
 
     if is_online:
         not_secure = device.status.get(_K.LINK_ENCRYPTED) is False


Test patch: