GNOME Bugzilla – Bug 382646
Text inside the combobox is drawn with text[XXX]
Last modified: 2015-07-31 12:53:55 UTC
The text in the GtkComboBox and its dropdown menu is drawn by the GtkCellRendererText. GtkCellRendererText always sets use_text when calling gtk_paint_layout, so that the themes text[] colors are used instead of fg[]. GtkComboBox should somehow force that the foreground colors get used when text is drawn in the menu and on a button.
Created attachment 77747 [details] [review] patch implementing this This patch adds a GTK_CELL_RENDERER_USE_FG flag to GtkCellRendererState to hint GtkCellRendererText to not set use_text. It also adds a property "use-fg" to GtkCellView to set the flag. This property is then set in the combobox where apprioriate.
Created attachment 78717 [details] [review] saner patch This patch includes a getter function for the property and should emit correct signals. I also tried generation of documentation and fixed a few things. The autogenerated stuff in the sgml files is not included.
Would be great to have this fixed, as it is a major pain when creating themes.
*** Bug 419973 has been marked as a duplicate of this bug. ***
Apparently it works, and its documented. Permission to apply? It would be nice to have clearer information about how this helps theme creators? For instance, what does it make possible, or easier?
This bug breaks the rule that the "text" color is always used together with "base", and "fg" always with "bg". This is a problem even when text[NORMAL] and fg[NORMAL] are the same, as the different states may be different. Of course it is much worst if they differ. Themes can work around this by trying to keep the text and foreground colors in sync (Clearlooks does this to some extend currently). But one needs to be carefull not to change too much when doing that.
*** Bug 484566 has been marked as a duplicate of this bug. ***
*** Bug 499727 has been marked as a duplicate of this bug. ***
*** Bug 519924 has been marked as a duplicate of this bug. ***
Created attachment 119825 [details] [review] Updated patch against trunk.
This looks obsolete now with GTK 3.
Hm, I think your are right, it should be working with GTK+ 3, as the style context is created for the correct widget. It looks like it is possible to correctly match the style depending on the parent widgets. Feel free to close the bug.
Is there a something the application developers can do on gtk+2 if it is not going to be fixed there?
You basically need the patch for GTK+ 2.x. There exist workarounds for themes at least for the combobox case. If an application runs into this issue because it uses GtkCellView, then it is rather hard to do a work around.
I don't think this is going to get fixed in 2.x