mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
Paper dialog: Use baseline alignment
This improves the positioning of the labels wrt to the spin buttons.
This commit is contained in:
parent
3e67b57396
commit
9d9a60c466
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user