Wishlist: Icon Support

Bug #782980 reported by naesk
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Hardware Sensors Indicator
Fix Released
Wishlist
Unassigned

Bug Description

Including icons for the relevant sensor would be a nice touch purely for aesthetics :)

naesk (naesk)
description: updated
Revision history for this message
Alex Murray (alexmurray) wrote :

I agree - but I'm no artist, so if you know anyone that can design some icons I'd be happy to code them in.

Changed in indicator-sensors:
importance: Undecided → Wishlist
Revision history for this message
naesk (naesk) wrote :

The following Tango based icons used in the GNOME Sensors applet http://www.uoguelph.ca/~fanguelo/tango-sensors-2.tar.gz

Revision history for this message
Alexander Usyskin (sanniu) wrote :

I've hacked partial solution for this.
Some parts are ported from old hardware sensors applet.

The most interested part missed in attached patch is colored overlays to temperature icons.
(It requires min/max temp ported from hardware sensors applet and dynamic indicator icon generation)

I'll continue to work on this then my spare time permits ;)

Revision history for this message
Alex Murray (alexmurray) wrote :

Thanks for the patch - the dynamic icon generation can probably be done using cairo surfaces etc, which are then written out to a file in some temporary location (~/.cache/indicator-sensors/icons/) perhaps (using g_get_user_cache_dir() for the ~/.cache part). And the max and min would probably be easy enough to add as properties to the IsSensor base class and then we could give them sensible defaults in each subclass (temperature, fan etc) which could further be set by individual plugins as required.

I also don't have much time lately to hack on this but I'll keep an eye on it too and hopefully we can get something together.

Revision history for this message
Alexander Usyskin (sanniu) wrote :

Attached complete patch against latest bzr. The temperature sensor has min/max values defaulted to 0/100C respectively.
No plugin changes this values for now.

Icons are to be put in pixmaps directory.

Revision history for this message
Alex Murray (alexmurray) wrote :

With just a quick look this seems like a pretty good approach - a few more comments:

* rather than precaching all the possible icon combinations at the start, it would be better to simply create each one when it is needed.
* rename icons to indicator-sensors-... rather than keeping the existing sensors-applet prefix
* min / max properties should be renamed as low / high since they don't really enforce min / maximum semantics, and they should probably exist for all sensor types, not just temperature sensors so then fan sensors could also be shown this way - finally these low / high values should be user configurable in the sensor properties dialog
* libsensors should probably set the low / high values if possible, along with other plugins

Also it would be really cool if the icons could also be displayed in the sensor list within the indicator's menu although I think this may be a little tricky.

Revision history for this message
Alexander Usyskin (sanniu) wrote :

Patch with all points fixed.
If low/high values are same - no overlay displayed, only icon. So by changing these values user can show overlay over any type of sensor.

"Also it would be really cool if the icons could also be displayed in the sensor list within the indicator's menu although I think this may be a little tricky." - is there any GTK menu item with icon and radio-box both? I can generate some combined image online, but it's not a good approach...

Revision history for this message
Alex Murray (alexmurray) wrote :

Thanks Alexander - this is really good - I've made a few cleanups to it and will push this into git soon - what email address can I use to credit you as the author for this patch in git?

I agree the icons in the menu is probably a bit tricky - so either it could change to using GtkImageMenuItems (instead of the GtkCheckMenuItem we currently use) and then perhaps show the main selected sensor label + value as bold? Or we just stick to how it currently is done with no image - I think I might try something like the image + bold and see if that works with dbusmenu etc.

Thanks again for this, it is really cool.

Alex Murray (alexmurray)
Changed in indicator-sensors:
status: New → In Progress
Revision history for this message
Alexander Usyskin (sanniu) wrote :

I'm glad that this will be merged :)
The e-mail is <email address hidden>

The image+bold sounds sounds like a perfect solution. Let's see if it's implementable.

P.S. There are some strings added in patch. Now it's came to me that these strings are translatable. Is language files must be updated too?

Revision history for this message
Alex Murray (alexmurray) wrote :

Just committed this into git - https://github.com/alexmurray/indicator-sensors/commit/69198f0dfc258b26ddd2d78968b1126472cda25a

I ended up changing it a bit more in the end, - always making icons enabled, moving the icon cache stuff into is-indicator since it seems not so sensor specific, and also changed to using named icons everywhere - this way plugins could provide their own icons if they wanted from the standard icon theme rather than just the short list of bundled icons in indicator-sensors.

Thanks again for your great work Alexander, muchly appreciated.

Changed in indicator-sensors:
status: In Progress → Fix Committed
Revision history for this message
Alex Murray (alexmurray) wrote :

Fixed in 0.1 release

Changed in indicator-sensors:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.