mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-15 21:20:09 +00:00
appchooserdialog: Don't show subtitle label when subtitle is null
Looks like67822d0c9a
and3f1bd3722d
collided, and subtitle can be null now. Add a check so that we don't end up with empty label in that case.
This commit is contained in:
parent
fd1fe0eed5
commit
80867acf94
@ -239,12 +239,15 @@ set_dialog_properties (GtkAppChooserDialog *self)
|
||||
gtk_widget_add_css_class (label, GTK_STYLE_CLASS_TITLE);
|
||||
gtk_widget_set_parent (label, box);
|
||||
|
||||
label = gtk_label_new (subtitle);
|
||||
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
|
||||
gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
|
||||
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
|
||||
gtk_widget_add_css_class (label, GTK_STYLE_CLASS_SUBTITLE);
|
||||
gtk_widget_set_parent (label, box);
|
||||
if (subtitle)
|
||||
{
|
||||
label = gtk_label_new (subtitle);
|
||||
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
|
||||
gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
|
||||
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
|
||||
gtk_widget_add_css_class (label, GTK_STYLE_CLASS_SUBTITLE);
|
||||
gtk_widget_set_parent (label, box);
|
||||
}
|
||||
|
||||
gtk_header_bar_set_title_widget (GTK_HEADER_BAR (header), box);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user