After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 157962 - Add colour coded buttons
Add colour coded buttons
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
unspecified
Other All
: Normal enhancement
: 3.0.0
Assigned To: gcalctool maintainers
gcalctool maintainers
: 513405 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-11-11 15:58 UTC by Rich Burridge
Modified: 2011-10-11 11:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
New colours (42.79 KB, image/png)
2010-03-31 11:55 UTC, Robert Ancell
Details

Description Rich Burridge 2004-11-11 15:58:27 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?"
Comment 1 Rich Burridge 2004-11-11 15:59:29 UTC
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).
Comment 2 Rich Burridge 2004-11-29 21:47:32 UTC
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.
Comment 3 Rich Burridge 2004-11-29 22:01:39 UTC
Changes checked into CVS HEAD. I'm bumped the
version number in configure.in to 5.5.17.
Comment 4 Alan Horkan 2004-12-02 18:33:49 UTC
Do you plan on adding a way to enable Colours from the Graphical user interface
such as menu item "View, Colours" perhaps?   
Comment 5 Rich Burridge 2004-12-02 19:05:19 UTC
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?
Comment 6 Rich Burridge 2007-11-03 15:26:29 UTC
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.
Comment 7 Rich Burridge 2008-01-31 15:36:31 UTC
*** Bug 513405 has been marked as a duplicate of this bug. ***
Comment 8 Robert Ancell 2008-09-23 10:16:44 UTC
I like this idea... bumping up priority. I would like to encourage a new developer to have a try (perhaps though gnome love)
Comment 9 Chris Lord 2010-03-30 23:47:00 UTC
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).
Comment 10 Robert Ancell 2010-03-30 23:58:19 UTC
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);
Comment 11 Robert Ancell 2010-03-31 07:13:22 UTC
I've committed some initial colours changes to git head, will modify colours and layout during 5.31 development.
Comment 12 Chris Lord 2010-03-31 09:10:40 UTC
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?
Comment 13 Robert Ancell 2010-03-31 11:55:12 UTC
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.
Comment 14 Fabian Greffrath 2011-10-11 11:01:49 UTC
Recent versions of gcalctool have lost their colored buttons again. :(