I've written an application using Python and Glade. The app has got a toolbar with a dark background, and each toolbar button has got a custom image (i.e. no stock icons are used).

I've noticed that when using stock icons instead of custom images as icons, whenever the mouse hovers over the button the button is highlighted, which does not happen with my custom images.

Thunderbird seems to go a step further and rather than highlighting the icons, it inverts their color, which works quite well for a dark theme (see below):

Button not highlighted, normal color

enter image description here

Button highlighted on hover, color inverted

enter image description here

How can I get my custom icon images or the buttons to be highlighted on hover?

  • Can you provide an example where it fails? It's probably a theme issue, or more likely a GTK+ bug, if it doesn't just work, and you aren't just sticking images in the toolbar, rather than buttons. – dobey May 17 '12 at 13:39
  • The code is at code.launchpad.net/qreator. I've double-checked and the toolbar is using buttons. The only thing that I'm doing is to load images for the icons, as far as I can tell. Also this might also be worth mentioning: bazaar.launchpad.net/~dpm/qreator/trunk/view/head:/qreator/… – David Planella May 17 '12 at 14:17
  • I think you should remove that code. It looks like maybe something quickly added for Gtk2 to do the funky toolbar stuff. – dobey May 17 '12 at 15:20
  • I actually added it after reading askubuntu.com/questions/67362/… - you guys were using it for the GTK Ubuntu One UI. Were you doing it differently? – David Planella May 17 '12 at 16:13
  • The old GTK+ U1 control panel was Gtk2, and any color changes were done with custom widgets which followed certain things from the theme. We were not using that bit of code, I am certain. Any toolbar in the normal place inside a GtkApplication in Gtk3 should just work in the manner you're expecting. – dobey May 17 '12 at 17:45

The issue is a problem with the Ambiance theme. There is a highlight, but the background color for the prelight is darker. If thunderbird is showing a light highlight and inverting the colors of the icons, then it is because it's using custom widgets in XUL (which isn't Gtk+), which aren't following the GTK+ or icon themes, for everything.

|improve this answer|||||
  • I guess I'll have to file a bug against Ambiance, thanks @dobey for the pointer! – David Planella May 19 '12 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.