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 697127 - gedit context menu uses fixed-width font
gedit context menu uses fixed-width font
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 699186 699203 700990 703050 704169 710677 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-04-02 17:34 UTC by Adam Dingle
Modified: 2013-10-22 19:56 UTC
See Also:
GNOME target: 3.10
GNOME version: ---


Attachments
Add a style class for context menus (11.34 KB, patch)
2013-08-18 14:50 UTC, Matthias Clasen
committed Details | Review
Set a font for context menus (998 bytes, patch)
2013-08-18 14:50 UTC, Matthias Clasen
committed Details | Review

Description Adam Dingle 2013-04-02 17:34:14 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.
Comment 1 Paolo Borelli 2013-04-02 19:32:53 UTC
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.
Comment 2 Ignacio Casal Quinteiro (nacho) 2013-04-29 06:21:12 UTC
*** Bug 699186 has been marked as a duplicate of this bug. ***
Comment 3 Adam Dingle 2013-05-07 20:15:09 UTC
See also bug 699203, which I suspect is related.
Comment 4 Matthias Clasen 2013-05-09 10:06:35 UTC
*** Bug 699203 has been marked as a duplicate of this bug. ***
Comment 5 Ignacio Casal Quinteiro (nacho) 2013-05-27 15:19:15 UTC
*** Bug 700990 has been marked as a duplicate of this bug. ***
Comment 6 Ignacio Casal Quinteiro (nacho) 2013-06-25 12:41:09 UTC
*** Bug 703050 has been marked as a duplicate of this bug. ***
Comment 7 Paolo Borelli 2013-07-14 08:31:23 UTC
*** Bug 704169 has been marked as a duplicate of this bug. ***
Comment 8 Raphael Rochet 2013-07-14 09:19:16 UTC
(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.
Comment 9 Cosimo Cecchi 2013-08-13 16:19:08 UTC
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?
Comment 10 Matthias Clasen 2013-08-18 14:50:32 UTC
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.
Comment 11 Matthias Clasen 2013-08-18 14:50:43 UTC
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.
Comment 12 Matthias Clasen 2013-08-18 14:51:16 UTC
here is one idea for how to fix this problem.
Comment 13 Matthias Clasen 2013-08-18 17:53:22 UTC
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
Comment 14 Matthias Clasen 2013-08-18 17:53:36 UTC
Attachment 252130 [details] pushed as 1db878b - Set a font for context menus
Comment 15 Garrett Regier 2013-10-22 19:56:52 UTC
*** Bug 710677 has been marked as a duplicate of this bug. ***