[clutter-gtk] examples: Use a size group for the spinbutton labels
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter-gtk] examples: Use a size group for the spinbutton labels
- Date: Tue, 15 Sep 2015 11:13:21 +0000 (UTC)
commit 276433864890daaf7a272f94ca741e1ece71a4a4
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Sep 15 12:12:31 2015 +0100
examples: Use a size group for the spinbutton labels
Makes the UI a bit less awful.
examples/gtk-clutter-events.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/examples/gtk-clutter-events.c b/examples/gtk-clutter-events.c
index abdeeeb..d357b78 100644
--- a/examples/gtk-clutter-events.c
+++ b/examples/gtk-clutter-events.c
@@ -137,6 +137,7 @@ main (gint argc, gchar **argv)
GtkWidget *widget, *vbox, *hbox, *button, *label, *box;
ClutterActor *actor;
GdkPixbuf *pixbuf = NULL;
+ GtkSizeGroup *size_group;
if (gtk_clutter_init_with_args (&argc, &argv, "- Event test", NULL, NULL, NULL) != CLUTTER_INIT_SUCCESS)
g_error ("Unable to initialize GtkClutter");
@@ -203,12 +204,14 @@ main (gint argc, gchar **argv)
clutter_actor_set_size (actor, 500, 20);
/* Create our adjustment widgets */
+ size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, TRUE, 0);
label = gtk_label_new ("Rotate x-axis");
+ gtk_size_group_add_widget (size_group, label);
gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
button = gtk_spin_button_new_with_range (0, 360, 1);
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
@@ -218,6 +221,7 @@ main (gint argc, gchar **argv)
gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, TRUE, 0);
label = gtk_label_new ("Rotate y-axis");
gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
+ gtk_size_group_add_widget (size_group, label);
button = gtk_spin_button_new_with_range (0, 360, 1);
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
g_signal_connect (button, "value-changed", G_CALLBACK (on_y_changed), app);
@@ -226,6 +230,7 @@ main (gint argc, gchar **argv)
gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, TRUE, 0);
label = gtk_label_new ("Rotate z-axis");
gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
+ gtk_size_group_add_widget (size_group, label);
button = gtk_spin_button_new_with_range (0, 360, 1);
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
g_signal_connect (button, "value-changed", G_CALLBACK (on_z_changed), app);
@@ -234,6 +239,7 @@ main (gint argc, gchar **argv)
gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, TRUE, 0);
label = gtk_label_new ("Adjust opacity");
gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
+ gtk_size_group_add_widget (size_group, label);
button = gtk_spin_button_new_with_range (0, 255, 1);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (button), 255);
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]