ui/gtk/list.c

changeset 827
eae5b817aa47
parent 824
a0ea8f3aa6e8
child 853
380ec881faa2
--- a/ui/gtk/list.c	Fri Oct 10 09:05:11 2025 +0200
+++ b/ui/gtk/list.c	Fri Oct 10 09:06:06 2025 +0200
@@ -245,7 +245,10 @@
         GtkEventController *focus_controller = gtk_event_controller_focus_new();
         g_signal_connect(focus_controller, "leave", G_CALLBACK(cell_entry_leave_focus), entry_data);
         gtk_widget_add_controller(textfield, focus_controller);
-    } else {
+    } else if(type == UI_BOOL_EDITABLE) {
+        GtkWidget *checkbox = gtk_check_button_new();
+        gtk_list_item_set_child(item, checkbox);
+    }else {
         GtkWidget *label = gtk_label_new(NULL);
         gtk_label_set_xalign(GTK_LABEL(label), 0);
         gtk_list_item_set_child(item, label);
@@ -390,6 +393,11 @@
             ENTRY_SET_TEXT(child, data);
             break;
         }
+        case UI_BOOL_EDITABLE: {
+            intptr_t i = (intptr_t)data;
+            gtk_check_button_set_active(GTK_CHECK_BUTTON(child), (gboolean)i);
+            break;
+        }
     }
     
     if(attributes != listview->current_row_attributes) {
@@ -417,6 +425,8 @@
         entry->listview = NULL;
         free(entry->previous_value);
         entry->previous_value = NULL;
+    } else if(GTK_IS_CHECK_BUTTON(child)) {
+        
     }
 }
     
@@ -1509,7 +1519,7 @@
 UIWIDGET ui_combobox_create(UiObject *obj, UiListArgs *args) {
     GtkWidget *combobox = gtk_combo_box_new();
     if(args->width > 0) {
-        gtk_widget_set_size_request(scroll_area, args->width, -1);
+        gtk_widget_set_size_request(combobox, args->width, -1);
     }
     
     ui_set_name_and_style(combobox, args->name, args->style_class);

mercurial