[gtk+] Paper dialog: Use baseline alignment



commit 9d9a60c466eb0d338d9c9d23c2e59469a712c64f
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jan 27 23:29:34 2014 -0500

    Paper dialog: Use baseline alignment
    
    This improves the positioning of the labels wrt to the spin
    buttons.

 gtk/gtkcustompaperunixdialog.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkcustompaperunixdialog.c b/gtk/gtkcustompaperunixdialog.c
index ec2c117..8dd43b7 100644
--- a/gtk/gtkcustompaperunixdialog.c
+++ b/gtk/gtkcustompaperunixdialog.c
@@ -556,6 +556,7 @@ new_unit_widget (GtkCustomPaperUnixDialog *dialog,
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
 
   button = gtk_spin_button_new_with_range (0.0, 9999.0, 1);
+  gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
   if (unit == GTK_UNIT_INCH)
     gtk_spin_button_set_digits (GTK_SPIN_BUTTON (button), 2);
   else
@@ -573,6 +574,7 @@ new_unit_widget (GtkCustomPaperUnixDialog *dialog,
     label = gtk_label_new (_("inch"));
   else
     label = gtk_label_new (_("mm"));
+  gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
 
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
   gtk_widget_show (label);
@@ -1124,7 +1126,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
 
   label = gtk_label_new_with_mnemonic (_("_Width:"));
   gtk_widget_set_halign (label, GTK_ALIGN_START);
-  gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
   gtk_widget_show (label);
   gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
 
@@ -1135,7 +1137,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
 
   label = gtk_label_new_with_mnemonic (_("_Height:"));
   gtk_widget_set_halign (label, GTK_ALIGN_START);
-  gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
   gtk_widget_show (label);
   gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
 
@@ -1155,7 +1157,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
 
   label = gtk_label_new_with_mnemonic (_("_Top:"));
   gtk_widget_set_halign (label, GTK_ALIGN_START);
-  gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
   gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
   gtk_widget_show (label);
 
@@ -1166,7 +1168,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
 
   label = gtk_label_new_with_mnemonic (_("_Bottom:"));
   gtk_widget_set_halign (label, GTK_ALIGN_START);
-  gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
   gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
   gtk_widget_show (label);
 
@@ -1177,7 +1179,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
 
   label = gtk_label_new_with_mnemonic (_("_Left:"));
   gtk_widget_set_halign (label, GTK_ALIGN_START);
-  gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
   gtk_grid_attach (GTK_GRID (grid), label, 0, 2, 1, 1);
   gtk_widget_show (label);
 
@@ -1188,7 +1190,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
 
   label = gtk_label_new_with_mnemonic (_("_Right:"));
   gtk_widget_set_halign (label, GTK_ALIGN_START);
-  gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
   gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
   gtk_widget_show (label);
 


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