mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
add58148bc
commit
c96e2d1767
1 changed files with 13 additions and 7 deletions
20
equipment.c
20
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);
|
||||
|
|
Loading…
Reference in a new issue