[Xfce4-commits] [xfce/thunar] 06/09: thunar-sbr: Use grid for better alignment with date renamer

noreply at xfce.org noreply at xfce.org
Fri Sep 7 03:23:09 CEST 2018


This is an automated email from the git hooks/post-receive script.

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       x   f   c   e   -   4   .   1   4   
   in repository xfce/thunar.

commit 2a848293e7823870c88977fd103907676ebb3426
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sat Sep 1 23:34:33 2018 -0400

    thunar-sbr: Use grid for better alignment with date renamer
---
 plugins/thunar-sbr/thunar-sbr-date-renamer.c | 32 +++++++++++++---------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/plugins/thunar-sbr/thunar-sbr-date-renamer.c b/plugins/thunar-sbr/thunar-sbr-date-renamer.c
index 218d215..1abb132 100644
--- a/plugins/thunar-sbr/thunar-sbr-date-renamer.c
+++ b/plugins/thunar-sbr/thunar-sbr-date-renamer.c
@@ -177,23 +177,21 @@ thunar_sbr_date_renamer_init (ThunarSbrDateRenamer *date_renamer)
   AtkRelationSet *relations;
   AtkRelation    *relation;
   AtkObject      *object;
-  GtkWidget      *vbox, *hbox;
+  GtkWidget      *grid, *hbox;
   GtkWidget      *label, *combo;
   GtkWidget      *spinner;
   GtkWidget      *entry;
   GtkAdjustment  *adjustment;
   guint           n;
 
-  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-  gtk_box_pack_start (GTK_BOX (date_renamer), vbox, TRUE, TRUE, 0);
-  gtk_widget_show (vbox);
-
-  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
-  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
-  gtk_widget_show (hbox);
+  grid = gtk_grid_new ();
+  gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+  gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
+  gtk_box_pack_start (GTK_BOX (date_renamer), grid, TRUE, TRUE, 0);
+  gtk_widget_show (grid);
 
   label = gtk_label_new_with_mnemonic (_("Insert _time:"));
-  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+  gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
   gtk_widget_show (label);
 
   combo = gtk_combo_box_text_new ();
@@ -201,7 +199,7 @@ thunar_sbr_date_renamer_init (ThunarSbrDateRenamer *date_renamer)
   for (n = 0; n < klass->n_values; ++n)
     gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _(klass->values[n].value_nick));
   exo_mutual_binding_new (G_OBJECT (date_renamer), "mode", G_OBJECT (combo), "active");
-  gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
+  gtk_grid_attach (GTK_GRID (grid), combo, 1, 0, 1, 1);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
   g_type_class_unref (klass);
   gtk_widget_show (combo);
@@ -214,12 +212,12 @@ thunar_sbr_date_renamer_init (ThunarSbrDateRenamer *date_renamer)
   g_object_unref (G_OBJECT (relation));
 
   label = gtk_label_new_with_mnemonic (_("_Format:"));
-  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+  gtk_grid_attach (GTK_GRID (grid), label, 2, 0, 1, 1);
   gtk_widget_show (label);
 
   entry = gtk_entry_new ();
   exo_mutual_binding_new (G_OBJECT (entry), "text", G_OBJECT (date_renamer), "format");
-  gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
+  gtk_grid_attach (GTK_GRID (grid), entry, 3, 0, 1, 1);
   gtk_widget_set_tooltip_text (entry,
                                _("The format describes the date and time parts to insert "
                                 "into the file name. For example, %Y will be substituted "
@@ -236,14 +234,14 @@ thunar_sbr_date_renamer_init (ThunarSbrDateRenamer *date_renamer)
   atk_relation_set_add (relations, relation);
   g_object_unref (G_OBJECT (relation));
 
-  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
-  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
-  gtk_widget_show (hbox);
-
   label = gtk_label_new_with_mnemonic (_("_At position:"));
-  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+  gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
   gtk_widget_show (label);
 
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+  gtk_grid_attach (GTK_GRID (grid), hbox, 1, 1, 3, 1);
+  gtk_widget_show (hbox);
+
   spinner = gtk_spin_button_new_with_range (0u, G_MAXUINT, 1u);
   gtk_entry_set_width_chars (GTK_ENTRY (spinner), 4);
   gtk_entry_set_alignment (GTK_ENTRY (spinner), 1.0f);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list