diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-05-11 19:08:53 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-05-11 19:08:53 +0000 |
commit | ba0579c6706476d82be896003238e8c4e12241ba (patch) | |
tree | 9f3664e1fc8d6b36398aaffb790202156752e36a /gtk/gtkfilechooserdialog.c | |
parent | 757c9675b0b405858ea0c68c5908842ee3d97381 (diff) | |
parent | 58fd969b2df3dfbd7c3f77a02ba1a8492060dca3 (diff) | |
download | gtk+-ba0579c6706476d82be896003238e8c4e12241ba.tar.gz |
Merge branch 'matthiasc/for-master' into 'master'
print-editor: Bring back the menubar
See merge request GNOME/gtk!1875
Diffstat (limited to 'gtk/gtkfilechooserdialog.c')
-rw-r--r-- | gtk/gtkfilechooserdialog.c | 67 |
1 files changed, 35 insertions, 32 deletions
diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c index 1eae65ae18..f7f8356c6c 100644 --- a/gtk/gtkfilechooserdialog.c +++ b/gtk/gtkfilechooserdialog.c @@ -488,38 +488,41 @@ setup_search (GtkFileChooserDialog *dialog) priv->widget, "search-mode", G_BINDING_BIDIRECTIONAL); - box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_widget_set_valign (box, GTK_ALIGN_CENTER); - - label = gtk_label_new (NULL); - 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_label_set_width_chars (GTK_LABEL (label), 5); - gtk_widget_add_css_class (label, GTK_STYLE_CLASS_TITLE); - gtk_widget_set_parent (label, box); - - g_object_bind_property (dialog, "title", - label, "label", - G_BINDING_SYNC_CREATE); - - label = gtk_label_new (NULL); - 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); - - g_object_bind_property (priv->widget, "subtitle", - label, "label", - G_BINDING_SYNC_CREATE); - g_object_bind_property_full (priv->widget, "subtitle", - label, "visible", - G_BINDING_SYNC_CREATE, - translate_subtitle_to_visible, - NULL, NULL, NULL); - - gtk_header_bar_set_title_widget (GTK_HEADER_BAR (header), box); + if (!priv->has_entry) + { + box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + gtk_widget_set_valign (box, GTK_ALIGN_CENTER); + + label = gtk_label_new (NULL); + 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_label_set_width_chars (GTK_LABEL (label), 5); + gtk_widget_add_css_class (label, GTK_STYLE_CLASS_TITLE); + gtk_widget_set_parent (label, box); + + g_object_bind_property (dialog, "title", + label, "label", + G_BINDING_SYNC_CREATE); + + label = gtk_label_new (NULL); + 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); + + g_object_bind_property (priv->widget, "subtitle", + label, "label", + G_BINDING_SYNC_CREATE); + g_object_bind_property_full (priv->widget, "subtitle", + label, "visible", + G_BINDING_SYNC_CREATE, + translate_subtitle_to_visible, + NULL, NULL, NULL); + + gtk_header_bar_set_title_widget (GTK_HEADER_BAR (header), box); + } gtk_container_forall (GTK_CONTAINER (header), add_button, dialog); } |