diff options
author | Daniel Boles <dboles@src.gnome.org> | 2018-03-16 22:11:58 +0000 |
---|---|---|
committer | Daniel Boles <dboles@src.gnome.org> | 2018-03-16 22:34:05 +0000 |
commit | 146082d4645ed7a7b0abe437947480b215ed5c5a (patch) | |
tree | 7a9d34a470ede1ca7aa5c6d1f8603ec96fe4c1e3 | |
parent | b64a4031006e29a9e54bccf85ff4a82251507307 (diff) | |
download | gtk+-146082d4645ed7a7b0abe437947480b215ed5c5a.tar.gz |
Notebook: Don’t show raw underline/markup in popup
If @menu_label == NULL, we create a default page->menu_label. This took
@tab_label.get_label() and passed that to page->menu_label.set_text().
This is wrong because we set the plain text of the menu_label from the
rich text of @tab_label. So, if @tab_label used mnemonics or markup, our
menu_label got the raw underline or markup tags shown in it as raw text.
As we call set_text() on the menu Label, the fix is to be symmetric: use
@tab_label’s get_text() as source, as that strips underlines and markup.
It’s not worth making the default Label ‘inherit’ :use-underline/markup;
that’s a slippery slope, and users wanting such things can just create a
fully fledged GtkLabel to pass as @menu_label to suppress the default.
https://bugzilla.gnome.org/show_bug.cgi?id=705509
-rw-r--r-- | gtk/gtknotebook.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 31f9c5328c..49e0445086 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -4332,7 +4332,7 @@ gtk_notebook_update_labels (GtkNotebook *notebook) { if (GTK_IS_LABEL (page->tab_label)) gtk_label_set_text (GTK_LABEL (page->menu_label), - gtk_label_get_label (GTK_LABEL (page->tab_label))); + gtk_label_get_text (GTK_LABEL (page->tab_label))); else gtk_label_set_text (GTK_LABEL (page->menu_label), string); } @@ -5560,7 +5560,7 @@ gtk_notebook_menu_item_create (GtkNotebook *notebook, if (page->default_menu) { if (GTK_IS_LABEL (page->tab_label)) - page->menu_label = gtk_label_new (gtk_label_get_label (GTK_LABEL (page->tab_label))); + page->menu_label = gtk_label_new (gtk_label_get_text (GTK_LABEL (page->tab_label))); else page->menu_label = gtk_label_new (""); gtk_widget_set_halign (page->menu_label, GTK_ALIGN_START); |