diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-11 15:37:56 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-11 15:49:50 -0700 |
commit | c96e2d1767f5c6379b2d7a780ccabc6039cf60bf (patch) | |
tree | c55feb5a2082c83a661fc4bc88cec70a147b0487 | |
parent | add58148bc30060e99e9c896fa4d390460c55694 (diff) | |
download | subsurface-c96e2d1767f5c6379b2d7a780ccabc6039cf60bf.tar.gz |
Pack all the equipment widgets into boxes
We really do want to "pack" them, rather than use up the whole size. I
think.
I may end up playing around more with this.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | equipment.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/equipment.c b/equipment.c index bab0d5335..2c25e03b1 100644 --- a/equipment.c +++ b/equipment.c @@ -136,13 +136,16 @@ void show_dive_equipment(struct dive *dive) static GtkWidget *create_spinbutton(GtkWidget *vbox, const char *name, double min, double max, double incr) { - GtkWidget *frame, *button; + GtkWidget *frame, *hbox, *button; frame = gtk_frame_new(name); - gtk_container_add(GTK_CONTAINER(vbox), frame); + gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, TRUE, 0); + + hbox = gtk_hbox_new(FALSE, 3); + gtk_container_add(GTK_CONTAINER(frame), hbox); button = gtk_spin_button_new_with_range(min, max, incr); - gtk_container_add(GTK_CONTAINER(frame), button); + gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, TRUE, 0); gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(button), GTK_UPDATE_IF_VALID); @@ -273,15 +276,18 @@ static void cylinder_widget(GtkWidget *box, int nr, GtkListStore *model) GtkWidget *widget; char buffer[80]; + hbox = gtk_hbox_new(FALSE, 3); + gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); + snprintf(buffer, sizeof(buffer), "Cylinder %d", nr); frame = gtk_frame_new(buffer); - gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(hbox), frame, FALSE, TRUE, 0); - hbox = gtk_hbox_new(TRUE, 3); + hbox = gtk_hbox_new(FALSE, 3); gtk_container_add(GTK_CONTAINER(frame), hbox); frame = gtk_frame_new("Description"); - gtk_box_pack_start(GTK_BOX(hbox), frame, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(hbox), frame, FALSE, TRUE, 0); widget = gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL(model), 0); gtk_container_add(GTK_CONTAINER(frame), widget); @@ -292,7 +298,7 @@ static void cylinder_widget(GtkWidget *box, int nr, GtkListStore *model) widget = create_spinbutton(hbox, "Size", 0, 200, 0.1); cylinder_size = GTK_SPIN_BUTTON(widget); - widget = create_spinbutton(hbox, "Working Pressure", 0, 5000, 1); + widget = create_spinbutton(hbox, "Pressure", 0, 5000, 1); cylinder_pressure = GTK_SPIN_BUTTON(widget); widget = create_spinbutton(hbox, "Nitrox", 21, 100, 0.1); |