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 128560 - Menu Items show incorrect foreground color in some themes.
Menu Items show incorrect foreground color in some themes.
Status: RESOLVED DUPLICATE of bug 142417
Product: gtkmm
Classification: Bindings
Component: general
2.4
Other Linux
: Normal minor
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2003-12-05 00:46 UTC by Marshall Culpepper
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.3/2.4



Description Marshall Culpepper 2003-12-05 00:46:36 UTC
This was compiled and tested under gtkmm-2.2.8 with the Industrial and
Bluecurve-Gnome GTK2 Themes.

relevant software: Fedora Core 1, Gnome 2.4, gtk 2.2.4

Under certain themes, when a menu item is selected (i.e, mouse over) the
foreground color of the menu item does not change correctly to the theme's
foreground color.

comparison:
Gtk+-2.0
   http://warlock.arcaner.com/gtk-demo-menu.png
Gtk--
   http://warlock.arcaner.com/gtkmm-demo-menu.png
Comment 1 Murray Cumming 2003-12-12 17:19:55 UTC
Where exactly did you get the themes? Is there a source tarball
somewhere? Sorry, I'm not on Fedora yet, just RedHat 9. I have tried
this with standard GNOME high-contrast themes, but can't reproduce it.

Are your GTK+ and gtkmm definitely in the same prefix?
Comment 2 Marshall Culpepper 2003-12-12 18:25:10 UTC
The Gnome-Bluecurve theme came with Fedora Core, and the Industrial 
GTK theme is a compiled theme downloaded from http://art.gnome.org.

The Industrial theme is installed under my local users home 
directory. The prefix for gtk+-2.2.4 is /usr and the prefix for 
gtkmm-2.2.8 is /usr/local.. will that make a difference?
Comment 3 Hagen.Moebius 2004-03-10 01:13:11 UTC
OK, I'm at this point now: I can reproduce the bug. I see what you
mean and I'm getting to it. I tried different combinations of Gtk and
Gtkmm classes. And now I'm diving into gtk code to look where the
actual drawing is done and which parameters are from where.
Comment 4 Hagen.Moebius 2004-03-10 02:19:17 UTC
I tracked it down ... after all not so difficult but hey, who could
know that. Bluecurve takes advantage of 2 feature of gtkrc.
1) you can define many different sub-styles of a default style. They
inherent it's properties and you can override some of them to change
the look. -- Bluecurve overrides the default style in the menu-item
style and resets the color for prelighted (mouse-over) text.

2) you can apply those specialized style classes to certain
widget_classes by name. -- Bluecurve sets this to the menu-item style
for the `class` "GtkMenuItem" and the `widget_class`
"*.GtkMenuItem.*". I don't know the difference between those two, but
I hope to get to it. (there must be some doc on the net)

Now the thing is that gtkmm creates new subclasses of the Gtk+ ones
and changes the name to gtkmm__GtkClassName. Now gtk does not know
that the menu-item style should be applied to gtkmm__GtkMenuItem. You
can fix this by yourself if you add a line to the Bluecurve gtkrc
file, like:

widget_class "*.gtkmm__GtkMenuItem.*" style "bluecurve-menu-item"

this way it works, but this is very unpleasant to change everything.

I'll look further to find out wether there exists a better solution.
Comment 5 Hagen.Moebius 2004-03-10 02:37:20 UTC
I have to admit that this is somewhat strange: the `class` directive
should sort this out. `class` is used in a hierarchical way. So any
widget that is of a class that is derieved from GtkMenuItem SHOULD get
this style too, but somehow it doesn't.
Comment 6 Murray Cumming 2004-03-12 11:21:08 UTC
Hagen, exactly what line of what source code file should I look at to
see this?
Comment 7 Hagen.Moebius 2004-03-13 15:20:02 UTC
No source code. This is intended to be common behavior for gtk+. The
documentation is at
http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html
under paragraph "Pathnames and patterns".

I'll paste an extract:
Matching against class is a little different. The pattern match is
done against all class names in the widgets class hierarchy (not the
layout hierarchy) in sequence, so the pattern:

class "GtkButton" style "my-style"

will match not just GtkButton widgets, but also GtkToggleButton and
GtkCheckButton widgets, since those classes derive from GtkButton.

This means that gtkmm__GtkMenuItem s should be matched for

class "GtkMenuItem" style "my-style"

too. I somehow get the feeling that this is an error within Gtk+ but
then again it works for the GtkImageMenuItem class which is derieved
from GtkMenuItem. I really don't know how to track this bug down any
further:

I wrote sample applications to layout the class hirarchy and there it
seems perfectly normal to me. I wrote sample apps to check for style
setting to the accellabel and the menuitem and it seems all very well
there to. But I don't completely understand the styles in Gtk+ so I
can't proof it that way ...
Comment 8 Murray Cumming 2004-06-03 19:47:45 UTC

*** This bug has been marked as a duplicate of 142417 ***