ui/gtk/container.c

branch
newapi
changeset 260
eebb0626d020
parent 253
087cc9216f28
child 267
79dd183dd4cb
--- a/ui/gtk/container.c	Thu Feb 15 21:04:21 2024 +0100
+++ b/ui/gtk/container.c	Thu Feb 15 21:12:54 2024 +0100
@@ -141,10 +141,11 @@
         gtk_widget_set_vexpand(widget, TRUE);
     }
     
-    int gwidth = ct->layout.gridwidth > 0 ? ct->layout.gridwidth : 1;
+    int colspan = ct->layout.colspan > 0 ? ct->layout.colspan : 1;
+    int rowspan = ct->layout.rowspan > 0 ? ct->layout.rowspan : 1;
     
-    gtk_grid_attach(GTK_GRID(ct->widget), widget, grid->x, grid->y, gwidth, 1);
-    grid->x += gwidth;
+    gtk_grid_attach(GTK_GRID(ct->widget), widget, grid->x, grid->y, colspan, rowspan);
+    grid->x += colspan;
     
     ui_reset_layout(ct->layout);
     ct->current = widget;
@@ -171,6 +172,10 @@
     GtkAttachOptions xoptions = hexpand ? GTK_FILL | GTK_EXPAND : GTK_FILL;
     GtkAttachOptions yoptions = vexpand ? GTK_FILL | GTK_EXPAND : GTK_FILL;
     
+    int colspan = ct->layout.colspan > 0 ? ct->layout.colspan : 1;
+    int rowspan = ct->layout.rowspan > 0 ? ct->layout.rowspan : 1;
+    // TODO: use colspan/rowspan
+    
     gtk_table_attach(GTK_TABLE(ct->widget), widget, grid->x, grid->x+1, grid->y, grid->y+1, xoptions, yoptions, 0, 0);
     grid->x++;
     int nw = grid->x > grid->width ? grid->x : grid->width;
@@ -367,11 +372,6 @@
     ct->layout.vexpand = expand;
 }
 
-void ui_layout_gridwidth(UiObject *obj, int width) {
-    UiContainer *ct = uic_get_current_container(obj);
-    ct->layout.gridwidth = width;
-}
-
 void ui_layout_colspan(UiObject* obj, int cols) {
     UiContainer* ct = uic_get_current_container(obj);
     ct->layout.colspan = cols;

mercurial