GNOME Bugzilla – Bug 157962
Add colour coded buttons
Last modified: 2011-10-11 11:01:49 UTC
This came from John Derrick via the bug tracking system for (g)calctool on SourceForge: "Just curious why color was removed from the GTK version. I liked the color coded buttons. Is color going to be reintegrated in the future?"
Yes, we very much want to add color back into gcalctool. I'm working with my HCI person on this (who's cc:'ed on this enhancement request).
I got the following from Calum: "To keep the a11y folks happy, if we wanted to have some sort of colourisation by default (which would be nice), the colours would have to be chosen from the theme, and we'd most likely want to provide an additional ability to user-define them. So far, though, I'm struggling to find theme colours that would work well for a high contrast user, let alone ones that would work across all three a11y themes, not to mention all the non-a11y ones as well. This mightn't be completely insurmountable (we did something similar for the gnomeprint page layout dialog, but that was only for solid colours, not fg+bg combinations)-- but it's certainly tricky." Because of this, and because gcalctool already supports color via Gtk+ resources, the plan is to adjust the gcalctoolrc file that is supplied with the source distribution, to provide a nice set of colors that work well with the default theme. If this gcalctoolrc file is copied to the user's home directory as ~/.gcalctoolrc and the gcalctool application is restarted, then it will startup in color. If users want to use a different set of colors for their version of gcalctool, than this can easily be done by starting from this file, and modifying accordingly to suit your taste.
Changes checked into CVS HEAD. I'm bumped the version number in configure.in to 5.5.17.
Do you plan on adding a way to enable Colours from the Graphical user interface such as menu item "View, Colours" perhaps?
This is a nice idea, particularly as there is a color chooser picker in gperfmeter that I could use. Reopened rfe so this can be thought about some more. Calum, rather than let the user choose any color for any button (which they can do if they really want to by modifying the ~/.gcalctoolrc file), changing button colors via menu items probably should just allow the setting of the three colors you've defined. Rather than "light-bg", "mid-bg" and "dark-bg" can you think of better names to distinguish the groups you created?
Now that we've got a "gcalctool-maint@gnome.bugs" alias, I'm reassigning several bugs and enhancement back to that. They are free to be picked up by one of the team and worked on.
*** Bug 513405 has been marked as a duplicate of this bug. ***
I like this idea... bumping up priority. I would like to encourage a new developer to have a try (perhaps though gnome love)
As requested, tips: To change button colour, use gtk_widget_modify_bg (and you'll probably want gtk_widget_modify_fg/text depending on the type of widget to modify the text colour and make sure it remains readable) This requires the theme to support this, but most themes do now (the pixmap theme has historically been the major exception).
Thanks Chris! Just what I was looking for. I tried the following to make the buttons red: GdkColor color; color.red = 65535; color.green = 0; color.blue = 0; gdk_colormap_alloc_color(gdk_colormap_get_system(), &color, FALSE, TRUE); gtk_widget_modify_bg(GET_WIDGET(name), GTK_STATE_NORMAL, &color);
I've committed some initial colours changes to git head, will modify colours and layout during 5.31 development.
Awesome, thanks so much for this :) May I suggest that you use colours from the Tango palette (http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines#Color_Palette) and that lightened and darkened (via gtk_rgb_to_hsv, changing value and then back to rgb) colours be set for the hover/active states, respectively?
Created attachment 157576 [details] New colours Actually I'm just blending primary colours with the theme colours - this way the buttons fit into the theme. That way I don't have to calculate any highlights and the buttons shininess match the theme. Seems to be working but I need to try with more themes.
Recent versions of gcalctool have lost their colored buttons again. :(