Ubuntu – Consistency of GTK2 menus with GTK3

gtkgtk-2gtkrcthemes

As mentioned in an OMG! Ubuntu! post, menus and toolbars of GTK3 apps are fixed in Ubuntu themes. But there’s still an inconsistency in Ubuntu theming between GTK2 and GTK3 menus where GTK2 apps don’t follow theme colors for menus.

I know this is possible in GTK2 as well by editing gtkrc file and setting the menu style the same as the existing dark style. Opening the gtkrc file, you can see these lines:

style "menu" {
xthickness = 0
ythickness = 0

engine "murrine"
{
    roundness = 0
}
}

Fixing the menu colors is as simple as changing the first line like this:

style "menu" = "dark" {
xthickness = 0
ythickness = 0

engine "murrine"
{
    roundness = 0
}
}

But this leads to a problem with ComboBox menus, especially with Ambiance because of the dark colors; for example, in Tomboy preferences all entries of a drop-down menu are illegible:

ComboBox menu in Tomboy preferences

I’ve just found the fix for this problem!

Best Answer

There’s a line in gtkrc which includes a workaround for a problem of ComboBox menus. The workaround replaces the colors of ComboBox entries with text color which is dark:

widget "*.gtk-combobox-popup-menu.*" style "menuitem_text_is_fg_color_workaround"

To fix the problem, a # mark should be inserted at the beginning of the line in order to be ignored and make menu entries colored in dark_fg_color which is light:

#widget "*.gtk-combobox-popup-menu.*" style "menuitem_text_is_fg_color_workaround"

Here’s an screenshot of the result:

ComboBox menu in Tomboy preferences