summaryrefslogtreecommitdiff
path: root/gtk/gtkcolorswatch.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2013-08-18 10:45:24 -0400
committerMatthias Clasen <mclasen@redhat.com>2013-08-18 13:46:48 -0400
commit624ec0fb7d5329261dd0c4a991c7889a70c61535 (patch)
tree4d4e31aaf825e5c9965c5f92b3c9a3b8327ba2c0 /gtk/gtkcolorswatch.c
parent8d7bab7d7b902e54f27d7dbe26bca9e21eb45787 (diff)
downloadgtk+-624ec0fb7d5329261dd0c4a991c7889a70c61535.tar.gz
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. https://bugzilla.gnome.org/show_bug.cgi?id=697127
Diffstat (limited to 'gtk/gtkcolorswatch.c')
-rw-r--r--gtk/gtkcolorswatch.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c
index a4073fd781..e2017a97a7 100644
--- a/gtk/gtkcolorswatch.c
+++ b/gtk/gtkcolorswatch.c
@@ -441,6 +441,9 @@ do_popup (GtkWidget *swatch,
GtkWidget *item;
menu = gtk_menu_new ();
+ gtk_style_context_add_class (gtk_widget_get_style_context (menu),
+ GTK_STYLE_CLASS_CONTEXT_MENU);
+
item = gtk_menu_item_new_with_mnemonic (_("_Customize"));
gtk_menu_attach_to_widget (GTK_MENU (menu), swatch, NULL);