Commit 568193ea authored by Sirbu Lavinia Stefania's avatar Sirbu Lavinia Stefania Committed by Carlos Soriano Sánchez

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 a child represented by a GtkBox. The GtkBox
contains a label and the toggle button for choosing an option of automatic
renaming. The child is revealed only when necesarry, more specifically when
the automatic numbering option is added.

https://bugzilla.gnome.org/show_bug.cgi?id=771813
parent d71b29fa
......@@ -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;
......@@ -1523,13 +1524,11 @@ 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_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_revealer_set_reveal_child(GTK_REVEALER(dialog->numbering_revealer), TRUE);
}
dialog->new_names = batch_rename_dialog_get_new_names (dialog);
......@@ -2095,6 +2094,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);
......
......@@ -154,51 +154,57 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="numbering_label">
<object class="GtkRevealer" id="numbering_revealer">
<property name="visible">True</property>
<property name="label" translatable="yes">Automatic Numbering Order</property>
<property name="can_focus">False</property>
<property name="height-request">35</property>
<property name="sensitive">False</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
<property name="width">1</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="numbering_order_button">
<property name="visible">True</property>
<signal name="toggled" handler="numbering_order_button_clicked" swapped="yes" />
<property name="halign">center</property>
<child>
<object class="GtkBox">
<object class="GtkBox" id="numbering_box">
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<property name="spacing">15</property>
<property name="spacing">10</property>
<child>
<object class="GtkLabel" id="numbering_order_label">
<object class="GtkLabel" id="numbering_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="label" translatable="yes">Automatic Numbering Order</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkImage" id="action_icon">
<object class="GtkToggleButton" id="numbering_order_button">
<property name="visible">True</property>
<property name="icon-name">pan-down-symbolic</property>
<property name="icon-size">1</property>
<signal name="toggled" handler="numbering_order_button_clicked" swapped="yes" />
<child>
<object class="GtkBox">
<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>
<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>
</child>
</object>
</child>
</object>
<packing>
<property name="left-attach">4</property>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
<property name="width">1</property>
<property name="width">5</property>
</packing>
</child>
</object>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment