[nautilus/wip/antoniof/max-width-chars-for-conflict-dialog: 1/2] file-conflict-dialog: Set max width for labels




commit 28e4d6738bcfdfb59fa95f41aded55ee3823c0f1
Author: António Fernandes <antoniof gnome org>
Date:   Wed Jan 6 00:57:28 2021 +0000

    file-conflict-dialog: Set max width for labels
    
    Files with very long names, or verbose translations, can make this
    dialog window too large.
    
    To ensure a sane width, set a maximum width for the labels.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=786701 as well as the
    issue reported in https://gitlab.gnome.org/GNOME/nautilus/-/issues/1727#note_998181

 src/nautilus-file-conflict-dialog.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/nautilus-file-conflict-dialog.c b/src/nautilus-file-conflict-dialog.c
index fdcaf2d81..d8f92e83e 100644
--- a/src/nautilus-file-conflict-dialog.c
+++ b/src/nautilus-file-conflict-dialog.c
@@ -67,6 +67,7 @@ nautilus_file_conflict_dialog_set_text (NautilusFileConflictDialog *fcd,
     gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
     gtk_label_set_line_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD_CHAR);
     gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+    gtk_label_set_max_width_chars (GTK_LABEL (label), 50);
     gtk_box_pack_start (GTK_BOX (fcd->titles_vbox), label, FALSE, FALSE, 0);
     gtk_widget_show (label);
 
@@ -79,7 +80,9 @@ nautilus_file_conflict_dialog_set_text (NautilusFileConflictDialog *fcd,
 
     label = gtk_label_new (secondary_text);
     gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+    gtk_label_set_line_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD_CHAR);
     gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+    gtk_label_set_max_width_chars (GTK_LABEL (label), 50);
     gtk_box_pack_start (GTK_BOX (fcd->titles_vbox), label, FALSE, FALSE, 0);
     gtk_widget_show (label);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]