GNOME Bugzilla – Bug 697127
gedit context menu uses fixed-width font
Last modified: 2013-10-22 19:56:52 UTC
To see the problem, simply start gedit and right click on any document. You'll see a context menu with items in fixed-width text; this is wrong. I see this in gedit 3.8.0 on both Fedora and Ubuntu, and also in git master.
This is the result of a change in gtk that now inherits the css from the textview. Benjamin and Matthias agree the result for context menus is wrong, but we need to figure out how to fix it.
*** Bug 699186 has been marked as a duplicate of this bug. ***
See also bug 699203, which I suspect is related.
*** Bug 699203 has been marked as a duplicate of this bug. ***
*** Bug 700990 has been marked as a duplicate of this bug. ***
*** Bug 703050 has been marked as a duplicate of this bug. ***
*** Bug 704169 has been marked as a duplicate of this bug. ***
(In reply to comment #1) > This is the result of a change in gtk that now inherits the css from the > textview. Benjamin and Matthias agree the result for context menus is wrong, > but we need to figure out how to fix it. I wonder how the gtk devs have come to think that textbox font is always the same as context menu font. The worst is in gnome-calculator, where text size is huge. Oh, there's a bonus in font selector dialog, the textbox used for testing selected font : instead of typing random text, just right click to have a good sample of the font :P I wish you will find a way to work around this.
Maybe a fix for this would be to make it so the font as set with gtk_widget_override_font() is not propagated like the rest of the theming properties set from CSS?
Created attachment 252129 [details] [review] Add a style class for context menus Attached widgets inherit from the style of the widget they are attached to. This can sometimes have unintended consequences, like a context menu in the main view of gedit inheriting the font that is configured for documents, or the context menu of the preview in the font chooser coming up with humongous font size. To fix this problem, we introduce a context menu style class and use it for all menus that are used like that. The theme can then set a font for this style class.
Created attachment 252130 [details] [review] Set a font for context menus GTK+ has recently started to add a dedicated style class to context menus. We set an explicit font for this class to prevent unintended inheritance, e.g. for context menus of the gedit document view or the preview entry in the font chooser.
here is one idea for how to fix this problem.
Comment on attachment 252129 [details] [review] Add a style class for context menus Attachment 252129 [details] pushed as 624ec0f - Add a style class for context menus
Attachment 252130 [details] pushed as 1db878b - Set a font for context menus
*** Bug 710677 has been marked as a duplicate of this bug. ***