mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Always pack the widgets into boxes, not frames
Let's try to be consistent about this. Make the parent of each widget be a box. Maybe the frames come with boxes, but since I have no clue about gtk, I'm going to just always create them by hand. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
5a47bdc9c4
commit
cb2f70f631
1 changed files with 5 additions and 8 deletions
13
equipment.c
13
equipment.c
|
@ -286,25 +286,22 @@ static void nitrox_cb(GtkToggleButton *button, gpointer data)
|
||||||
|
|
||||||
static void cylinder_widget(GtkWidget *box, int nr, GtkListStore *model)
|
static void cylinder_widget(GtkWidget *box, int nr, GtkListStore *model)
|
||||||
{
|
{
|
||||||
GtkWidget *frame, *hbox;
|
GtkWidget *frame, *hbox, *hbox2;
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
char buffer[80];
|
char buffer[80];
|
||||||
|
|
||||||
hbox = gtk_hbox_new(FALSE, 3);
|
hbox = gtk_hbox_new(FALSE, 3);
|
||||||
gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
|
gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
|
||||||
|
|
||||||
snprintf(buffer, sizeof(buffer), "Cylinder %d", nr);
|
snprintf(buffer, sizeof(buffer), "Cylinder %d", nr+1);
|
||||||
frame = gtk_frame_new(buffer);
|
frame = gtk_frame_new(buffer);
|
||||||
gtk_box_pack_start(GTK_BOX(hbox), frame, FALSE, TRUE, 0);
|
gtk_box_pack_start(GTK_BOX(hbox), frame, FALSE, TRUE, 0);
|
||||||
|
|
||||||
hbox = gtk_hbox_new(FALSE, 3);
|
hbox2 = gtk_hbox_new(FALSE, 3);
|
||||||
gtk_container_add(GTK_CONTAINER(frame), hbox);
|
gtk_container_add(GTK_CONTAINER(frame), hbox2);
|
||||||
|
|
||||||
frame = gtk_frame_new("Description");
|
|
||||||
gtk_box_pack_start(GTK_BOX(hbox), frame, FALSE, TRUE, 0);
|
|
||||||
|
|
||||||
widget = gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL(model), 0);
|
widget = gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL(model), 0);
|
||||||
gtk_container_add(GTK_CONTAINER(frame), widget);
|
gtk_box_pack_start(GTK_BOX(hbox2), widget, FALSE, TRUE, 0);
|
||||||
|
|
||||||
cylinder_description = GTK_COMBO_BOX(widget);
|
cylinder_description = GTK_COMBO_BOX(widget);
|
||||||
g_signal_connect(widget, "changed", G_CALLBACK(cylinder_cb), NULL);
|
g_signal_connect(widget, "changed", G_CALLBACK(cylinder_cb), NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue