ui/gtk/list.c

changeset 1247
070d0472e6af
parent 1246
43a7874a9d0e
equal deleted inserted replaced
1246:43a7874a9d0e 1247:070d0472e6af
3231 "clicked", 3231 "clicked",
3232 G_CALLBACK(listbox2_button_clicked), 3232 G_CALLBACK(listbox2_button_clicked),
3233 rowdata); 3233 rowdata);
3234 gtk_widget_set_visible(button, FALSE); 3234 gtk_widget_set_visible(button, FALSE);
3235 WIDGET_NO_SHOW_ALL(button); 3235 WIDGET_NO_SHOW_ALL(button);
3236
3237 g_object_set_data(G_OBJECT(row), "ui-listbox-row-button", button);
3236 } 3238 }
3237 3239
3238 // headings have the expander at the end 3240 // headings have the expander at the end
3239 if(item->is_header) { 3241 if(item->is_header) {
3240 BOX_ADD(hbox, expander); 3242 BOX_ADD(hbox, expander);
3269 if(listbox->getvalue) { 3271 if(listbox->getvalue) {
3270 listbox->getvalue(list, elm, index, &item, listbox->getvaluedata); 3272 listbox->getvalue(list, elm, index, &item, listbox->getvaluedata);
3271 } 3273 }
3272 3274
3273 GtkWidget *row = gtk_list_box_row_new(); 3275 GtkWidget *row = gtk_list_box_row_new();
3276 #if GTK_CHECK_VERSION(4, 0, 0)
3277 GtkEventController *motion_controller = gtk_event_controller_motion_new();
3278 gtk_widget_add_controller(GTK_WIDGET(row), motion_controller);
3279 g_signal_connect(motion_controller, "enter", G_CALLBACK(listbox_row_enter), row);
3280 g_signal_connect(motion_controller, "leave", G_CALLBACK(listbox_row_leave), row);
3281 #else
3282 gtk_widget_set_events(GTK_WIDGET(row), GDK_POINTER_MOTION_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
3283 g_signal_connect(row, "enter-notify-event", G_CALLBACK(listbox_row_enter), NULL);
3284 g_signal_connect(row, "leave-notify-event", G_CALLBACK(listbox_row_leave), NULL);
3285 #endif
3286
3274 gtk_list_box_append(listbox->listbox, row); 3287 gtk_list_box_append(listbox->listbox, row);
3275 UiListBox2Row row_data = {0}; 3288 UiListBox2Row row_data = {0};
3276 row_data.listbox = listbox; 3289 row_data.listbox = listbox;
3277 row_data.row = row; 3290 row_data.row = row;
3278 row_data.index = index; 3291 row_data.index = index;

mercurial