ui/gtk/container.c

changeset 109
b9808f916687
parent 107
9aff1dc3990d
child 110
36f1581b43e2
equal deleted inserted replaced
108:fcf6d5fac8f5 109:b9808f916687
137 } 137 }
138 if(vexpand) { 138 if(vexpand) {
139 gtk_widget_set_vexpand(widget, TRUE); 139 gtk_widget_set_vexpand(widget, TRUE);
140 } 140 }
141 141
142 gtk_grid_attach(GTK_GRID(ct->widget), widget, grid->x, grid->y, 1, 1); 142 int gwidth = ct->layout.gridwidth > 0 ? ct->layout.gridwidth : 1;
143
144 gtk_grid_attach(GTK_GRID(ct->widget), widget, grid->x, grid->y, gwidth, 1);
143 grid->x++; 145 grid->x++;
144 146
145 ui_reset_layout(ct->layout); 147 ui_reset_layout(ct->layout);
146 ct->current = widget; 148 ct->current = widget;
147 } 149 }
471 void ui_layout_vexpand(UiObject *obj, UiBool expand) { 473 void ui_layout_vexpand(UiObject *obj, UiBool expand) {
472 UiContainer *ct = uic_get_current_container(obj); 474 UiContainer *ct = uic_get_current_container(obj);
473 ct->layout.vexpand = ui_bool2lb(expand); 475 ct->layout.vexpand = ui_bool2lb(expand);
474 } 476 }
475 477
478 void ui_layout_gridwidth(UiObject *obj, int width) {
479 UiContainer *ct = uic_get_current_container(obj);
480 ct->layout.gridwidth = width;
481 }
482
476 void ui_newline(UiObject *obj) { 483 void ui_newline(UiObject *obj) {
477 UiContainer *ct = uic_get_current_container(obj); 484 UiContainer *ct = uic_get_current_container(obj);
478 ct->layout.newline = TRUE; 485 ct->layout.newline = TRUE;
479 } 486 }
480 487

mercurial