Issue 103999 - doesn't inherit GTK colours properly
Summary: doesn't inherit GTK colours properly
Alias: None
Product: General
Classification: Code
Component: ui (show other issues)
Version: OOo 3.0
Hardware: Unknown All
: P3 Trivial with 4 votes (vote)
Target Milestone: OOo 3.3
Assignee: stefan.baltzer
QA Contact: issues@framework
Depends on:
Reported: 2009-08-04 15:39 UTC by hbons
Modified: 2017-05-20 10:23 UTC (History)
4 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---

Tentative patch (7.57 KB, patch)
2009-08-18 15:25 UTC, tml
no flags Details | Diff
Source RPM for the theme and its engine (29.54 KB, application/octet-stream)
2010-04-26 14:55 UTC, tml
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description hbons 2009-08-04 15:39:32 UTC doesn't inherit GTK colours properly. OOo doesn't inherit the
text[NORMAL] gtk colour for the menu bar/item text colour as it should.
Especially noticeable in dark themes, OOo renders is as dark text on a dark
Comment 1 tml 2009-08-05 03:40:40 UTC
Version 1.0.0?
Comment 2 hbons 2009-08-05 10:41:16 UTC
I couldn't select an other version number. It happens in 3.x.
Comment 3 philipp.lohmann 2009-08-05 12:22:59 UTC
Currently the menu text color is taken from fg[NORMAL]. That is probably wrong ?
Comment 4 hbons 2009-08-05 13:23:44 UTC
pl: yes, it needs to inherit the text[NORMAL] colour.
Comment 5 tml 2009-08-18 13:01:27 UTC
Isn't the problem more that OOo uses the same text color both for menubar and menu?

Or is this a different problem? If the GTK theme uses a dark background color
and light text for menubars, and a light background and dark text for menus, the
menubar text is not visible in OOo. To fix this problem, I came up with a patch
that adds a separate MenuBarTextColor field, and setters and getters for it, to
the classes in question, and then use that for menubar text, and set it
appropriately in the gtk+ theme sniffing code in OOo.
Comment 6 philipp.lohmann 2009-08-18 13:55:12 UTC
If there are themes that do use different text colors for menubars, then an
additional entry in Settings would indeed be the solution for that.
Comment 7 tml 2009-08-18 15:25:18 UTC
Created attachment 64239 [details]
Tentative patch
Comment 8 tml 2009-08-18 15:29:34 UTC
The above patch is for the (separate) issue I mention. Note that the patch also
contains a heuristic hack to fix a third issue, related to menu separators (look
for "Awful hack"), that part you don't necessarily want. Patch is for
ooo310-m18, but afaik the affected code in dev300-m* is mostly the same?
Comment 9 philipp.lohmann 2009-08-18 16:11:08 UTC
great patch ! I'll commit it to CWS vcl104 if you don't mind. The only other
change necessary would be using text instead of fg, right ? About the "awful
hack": that doesn't seem so awful, but we'll probably want that checked on
different themes :-) Especially since it influences the borders of other
controls than the menus.
Comment 10 philipp.lohmann 2009-08-24 10:49:01 UTC
committed in CWS vcl104; however the mentioned sonar theme does not seem to use
different text colors for menubar and menu. I also changed getting the text
colors from the text gc instead of fg.
Comment 11 tml 2009-08-24 12:05:40 UTC
No, it's the Moblin theme that uses different colours for menu bar and menu
items. Thanks!
Comment 12 philipp.lohmann 2009-08-25 12:40:07 UTC
verified in CWS vcl104
Comment 13 philipp.lohmann 2009-10-13 14:28:20 UTC
Comment 14 j_baer 2009-10-24 16:56:49 UTC
This issue is also apparent in Ubuntu 9.10 OpenOffice 3.1.1 (build:9420) with
any theme that uses a dark menu background color.

Earlier versions of OpenOffice (Ubuntu 9.04 OpenOffice v3.0) does not have this

Comment 15 tml 2010-04-26 12:49:07 UTC
Unfortunately it seems that the change to my patch that pl mentions below on
"Tue Aug 18 15:11:08 +0000 2009" made the menu bar entries invisible in a theme
with a dark menu bar background with light menu bar entries. Reverting it back to 

    aTextColor = getColor( pMenubarStyle->fg[GTK_STATE_NORMAL] );
    aStyleSet.SetMenuBarTextColor( aTextColor );

seems to help and has no visible bad effect on other themes as far as I can see.

Comment 16 philipp.lohmann 2010-04-26 13:54:06 UTC
The only two "white on dark" themes I have (Sonar and High Contrast Inverse) do
not show a problem - with or without the change to "fg" instead of "text" GC.
Can you please give me a reference to a theme where the problem occurs ?
Comment 17 tml 2010-04-26 14:48:31 UTC
The theme in question is "Moblin Netbook", available in a package called
moblin-gtk-engine in some distros. It uses a theme engine, so I guess you need
to build the theme engine from sources, just using the gtkrc file won't be
enough. Will attach the src.rpm.
Comment 18 tml 2010-04-26 14:55:14 UTC
Created attachment 69126 [details]
Source RPM for the theme and its engine
Comment 19 philipp.lohmann 2010-04-26 15:31:43 UTC
Ok, with that theme I see the problem. Reopening issue.
Comment 20 philipp.lohmann 2010-04-26 15:33:21 UTC
change the menubar text color back to "fg" instead of "text" in CWS vcl111
Comment 21 philipp.lohmann 2010-04-30 15:50:55 UTC
and just changed the menu text color back to "fg" also, since I noticed the same
problem here in the "Dark Room" theme on Ubuntu.
Comment 22 philipp.lohmann 2010-05-21 12:20:35 UTC
please verify in CWS vcl111
Comment 23 ccheney 2010-05-22 04:16:01 UTC
There are other similar issues to this, or maybe they end up falling under this
as well? For example this picture of Base with a dark theme in Ubuntu.

Notice the section titles are dark grey on black (or extremely dark grey) which
makes it nearly impossible to read.

Should I file a separate bug about this?
Comment 24 stefan.baltzer 2010-06-09 13:08:22 UTC
Verified in CWS vcl111.