mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
label: Fix mnemonic handling
We were not handling the case right in which we want to use underlines, but not use markup. Since we are now using pango_parse_markup for this case, we need to escape the xml markup. Fixes: #4041
This commit is contained in:
parent
a3882763d8
commit
c4a2234a28
@ -2981,8 +2981,18 @@ gtk_label_recalculate (GtkLabel *self)
|
||||
gtk_label_clear_layout (self);
|
||||
gtk_label_clear_select_info (self);
|
||||
|
||||
if (self->use_markup || self->use_underline)
|
||||
gtk_label_set_markup_internal (self, self->label, self->use_underline);
|
||||
if (self->use_markup)
|
||||
{
|
||||
gtk_label_set_markup_internal (self, self->label, self->use_underline);
|
||||
}
|
||||
else if (self->use_underline)
|
||||
{
|
||||
char *text;
|
||||
|
||||
text = g_markup_escape_text (self->label, -1);
|
||||
gtk_label_set_markup_internal (self, text, TRUE);
|
||||
g_free (text);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_clear_pointer (&self->markup_attrs, pango_attr_list_unref);
|
||||
|
Loading…
Reference in New Issue
Block a user