[nautilus] batch-rename-dialog: revealer for auto numbering



commit b37950722078595699b127b154ea07e9c57cbc09
Author: Sirbu Lavinia Stefania <sirbu lavinia stefania gmail com>
Date:   Tue Sep 27 18:57:21 2016 -0400

    batch-rename-dialog: revealer for auto numbering
    
    Currently we have a big padding that initially has no meaning.
    
    The problem is that when using the rename for multiple files, we initially
    have an extra padding due to auto numbering. Even if the automatic numbering
    is not used, the space for the toggle button used for the numbering options
    is now blank and waiting for a possible use of the automatic option.
    
    Add a GtkReaveler that contains the toggle button and reveals his child only
    when necesarry, when the automatic numbering option is added.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771813

 src/nautilus-batch-rename-dialog.c               |    8 +++-
 src/resources/ui/nautilus-batch-rename-dialog.ui |   41 ++++++++++++---------
 2 files changed, 29 insertions(+), 20 deletions(-)
---
diff --git a/src/nautilus-batch-rename-dialog.c b/src/nautilus-batch-rename-dialog.c
index 7f805ae..7b7213e 100644
--- a/src/nautilus-batch-rename-dialog.c
+++ b/src/nautilus-batch-rename-dialog.c
@@ -56,6 +56,7 @@ struct _NautilusBatchRenameDialog
     GtkWidget *scrolled_window;
     GtkWidget *numbering_order_popover;
     GtkWidget *numbering_order_button;
+    GtkWidget *numbering_revealer;
     GtkWidget *conflict_box;
     GtkWidget *conflict_label;
     GtkWidget *conflict_down;
@@ -1524,12 +1525,14 @@ update_display_text (NautilusBatchRenameDialog *dialog)
     if (!numbering_tag_is_some_added (dialog))
     {
         gtk_label_set_label (GTK_LABEL (dialog->numbering_label), "");
-        gtk_widget_hide (dialog->numbering_order_button);
+        gtk_widget_hide (dialog->numbering_label);
+        gtk_revealer_set_reveal_child(GTK_REVEALER(dialog->numbering_revealer), FALSE);
     }
     else
     {
         gtk_label_set_label (GTK_LABEL (dialog->numbering_label), _("Automatic Numbering Order"));
-        gtk_widget_show (dialog->numbering_order_button);
+        gtk_widget_show (dialog->numbering_label);
+        gtk_revealer_set_reveal_child(GTK_REVEALER(dialog->numbering_revealer), TRUE);
     }
 
     dialog->new_names = batch_rename_dialog_get_new_names (dialog);
@@ -2095,6 +2098,7 @@ nautilus_batch_rename_dialog_class_init (NautilusBatchRenameDialogClass *klass)
     gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, scrolled_window);
     gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, numbering_order_popover);
     gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, numbering_order_button);
+    gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, numbering_revealer);
     gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, numbering_order_menu);
     gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, conflict_box);
     gtk_widget_class_bind_template_child (widget_class, NautilusBatchRenameDialog, conflict_label);
diff --git a/src/resources/ui/nautilus-batch-rename-dialog.ui 
b/src/resources/ui/nautilus-batch-rename-dialog.ui
index d4bef6d..bb05a3c 100644
--- a/src/resources/ui/nautilus-batch-rename-dialog.ui
+++ b/src/resources/ui/nautilus-batch-rename-dialog.ui
@@ -155,7 +155,7 @@
                     </child>
                     <child>
                       <object class="GtkLabel" id="numbering_label">
-                        <property name="visible">True</property>
+                        <property name="visible">False</property>
                         <property name="label" translatable="yes">Automatic Numbering Order</property>
                         <property name="can_focus">False</property>
                         <property name="height-request">35</property>
@@ -168,28 +168,33 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkToggleButton" id="numbering_order_button">
+                      <object class="GtkRevealer" id="numbering_revealer">
                         <property name="visible">True</property>
-                        <signal name="toggled" handler="numbering_order_button_clicked" swapped="yes" />
                         <child>
-                          <object class="GtkBox">
+                          <object class="GtkToggleButton" id="numbering_order_button">
                             <property name="visible">True</property>
-                            <property name="orientation">horizontal</property>
-                            <property name="spacing">15</property>
-                            <child>
-                              <object class="GtkLabel" id="numbering_order_label">
-                                <property name="visible">True</property>
-                                <property name="width-request">180</property>
-                                <property name="xalign">0</property>
-                                <property name="label" translatable="yes">Original Name 
(Ascending)</property>
-                                <property name="can_focus">False</property>
-                              </object>
-                            </child>
+                            <signal name="toggled" handler="numbering_order_button_clicked" swapped="yes" />
                             <child>
-                              <object class="GtkImage" id="action_icon">
+                              <object class="GtkBox">
                                 <property name="visible">True</property>
-                                <property name="icon-name">pan-down-symbolic</property>
-                                <property name="icon-size">1</property>
+                                <property name="orientation">horizontal</property>
+                                <property name="spacing">15</property>
+                                <child>
+                                  <object class="GtkLabel" id="numbering_order_label">
+                                    <property name="visible">True</property>
+                                    <property name="width-request">180</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Original Name 
(Ascending)</property>
+                                    <property name="can_focus">False</property>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkImage" id="action_icon">
+                                    <property name="visible">True</property>
+                                    <property name="icon-name">pan-down-symbolic</property>
+                                    <property name="icon-size">1</property>
+                                  </object>
+                                </child>
                               </object>
                             </child>
                           </object>


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