implement table columnsize (GTK4) default tip

Mon, 13 Jan 2025 22:55:37 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 13 Jan 2025 22:55:37 +0100
changeset 446
535089a269c8
parent 445
5059f2435775

implement table columnsize (GTK4)

ui/gtk/list.c file | annotate | diff | comparison | revisions
--- a/ui/gtk/list.c	Mon Jan 13 22:50:38 2025 +0100
+++ b/ui/gtk/list.c	Mon Jan 13 22:55:37 2025 +0100
@@ -388,6 +388,13 @@
         GtkColumnViewColumn *column = gtk_column_view_column_new(model->titles[i], factory);
         gtk_column_view_column_set_resizable(column, true);
         gtk_column_view_append_column(GTK_COLUMN_VIEW(view), column);
+        
+        int size = model->columnsize[i];
+        if(size > 0) {
+            gtk_column_view_column_set_fixed_width(column, size);
+        } else if(size < 0) {
+            gtk_column_view_column_set_expand(column, TRUE);
+        }
     }
     
     // bind listview to list

mercurial