[nautilus] batch-rename-dialog: Update tooltip on label change



commit a50f6e72b69e7f83d2289f444bc708301fe10541
Author: Alexandru Pandelea <alexandru pandelea gmail com>
Date:   Mon Oct 3 11:33:13 2016 +0300

    batch-rename-dialog: Update tooltip on label change
    
    The tooltip is not updated if the label will be changed.
    
    To fix this, update the tooltip text each time the label changes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772191

 src/nautilus-batch-rename-dialog.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-batch-rename-dialog.c b/src/nautilus-batch-rename-dialog.c
index 050d566..170919f 100644
--- a/src/nautilus-batch-rename-dialog.c
+++ b/src/nautilus-batch-rename-dialog.c
@@ -626,7 +626,6 @@ create_original_name_row_for_label (NautilusBatchRenameDialog *dialog,
     gtk_label_set_xalign (GTK_LABEL (label_old), 0.0);
     gtk_widget_set_hexpand (label_old, TRUE);
     gtk_widget_set_margin_start (label_old, ROW_MARGIN_START);
-    gtk_widget_set_tooltip_text(label_old, old_text);
     gtk_label_set_ellipsize (GTK_LABEL (label_old), PANGO_ELLIPSIZE_END);
 
     dialog->listbox_labels_old = g_list_prepend (dialog->listbox_labels_old, label_old);
@@ -653,7 +652,6 @@ create_result_row_for_label (NautilusBatchRenameDialog *dialog,
     gtk_label_set_xalign (GTK_LABEL (label_new), 0.0);
     gtk_widget_set_hexpand (label_new, TRUE);
     gtk_widget_set_margin_start (label_new, ROW_MARGIN_START);
-    gtk_widget_set_tooltip_text(label_new, new_text);
     gtk_label_set_ellipsize (GTK_LABEL (label_new), PANGO_ELLIPSIZE_END);
 
     dialog->listbox_labels_new = g_list_prepend (dialog->listbox_labels_new, label_new);
@@ -980,6 +978,7 @@ update_listbox (NautilusBatchRenameDialog *dialog)
         new_name = l1->data;
 
         gtk_label_set_label (label, new_name->str);
+        gtk_widget_set_tooltip_text(GTK_WIDGET (label), new_name->str);
 
         if (g_strcmp0 (new_name->str, "") == 0)
         {
@@ -993,6 +992,7 @@ update_listbox (NautilusBatchRenameDialog *dialog)
         file = NAUTILUS_FILE (l1->data);
 
         old_name = nautilus_file_get_name (file);
+        gtk_widget_set_tooltip_text(GTK_WIDGET (label), old_name);
 
         if (dialog->mode == NAUTILUS_BATCH_RENAME_DIALOG_FORMAT)
         {


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