ui/gtk/list.c

changeset 118
6d0da97105d8
parent 117
b174e721663e
--- a/ui/gtk/list.c	Sat Dec 27 22:47:56 2025 +0100
+++ b/ui/gtk/list.c	Thu Jan 08 18:06:04 2026 +0100
@@ -1021,7 +1021,7 @@
         void *data = listview->getvalue(list, elm, row, c, listview->getvaluedata, &freevalue);
         
         UiModelType type = model->types[i];
-        
+        UiTextStyle cstyle = { 0, 0 };
         if(getstyle) {
             // in case the column is icon+text, only get a style for the text column
             int style_col = c;
@@ -1032,8 +1032,15 @@
             // Get the individual column style 
             // The column style overrides the row style, however if no column style
             // is provided, we stick with the row style
-            if(getstyle(list, elm, row, style_col, listview->getstyledata, &style)) {
+            if(getstyle(list, elm, row, style_col, listview->getstyledata, &cstyle)) {
                 style_set = TRUE;
+                cstyle.text_style |= style.text_style;
+                if(!cstyle.fg_set) {
+                    cstyle.fg_set = style.fg_set;
+                    cstyle.fg = style.fg;
+                }
+            } else {
+                cstyle = style;
             }
         }
 
@@ -1139,7 +1146,7 @@
             
             GValue style_weight_value = G_VALUE_INIT;
             g_value_init(&style_weight_value, G_TYPE_INT);
-            if(style.text_style & UI_TEXT_STYLE_BOLD) {
+            if(cstyle.text_style & UI_TEXT_STYLE_BOLD) {
                 g_value_set_int(&style_weight_value, 600);
             } else {
                 g_value_set_int(&style_weight_value, 400);
@@ -1148,7 +1155,7 @@
             
             GValue style_underline_value = G_VALUE_INIT;
             g_value_init(&style_underline_value, G_TYPE_INT);
-            if(style.text_style & UI_TEXT_STYLE_UNDERLINE) {
+            if(cstyle.text_style & UI_TEXT_STYLE_UNDERLINE) {
                 g_value_set_int(&style_underline_value, PANGO_UNDERLINE_SINGLE);
             } else {
                 g_value_set_int(&style_underline_value, PANGO_UNDERLINE_NONE);
@@ -1157,7 +1164,7 @@
             
             GValue style_italic_value = G_VALUE_INIT;
             g_value_init(&style_italic_value, G_TYPE_INT);
-            if(style.text_style & UI_TEXT_STYLE_ITALIC) {
+            if(cstyle.text_style & UI_TEXT_STYLE_ITALIC) {
                 g_value_set_int(&style_italic_value, PANGO_STYLE_ITALIC);
             } else {
                 g_value_set_int(&style_italic_value, PANGO_STYLE_NORMAL);
@@ -1166,12 +1173,12 @@
             
             GValue style_fgset_value = G_VALUE_INIT;
             g_value_init(&style_fgset_value, G_TYPE_BOOLEAN);
-            g_value_set_boolean(&style_fgset_value, style.fg_set);
+            g_value_set_boolean(&style_fgset_value, cstyle.fg_set);
             gtk_list_store_set_value(store, iter, soff + 4, &style_fgset_value);
             
-            if(style.fg_set) {
+            if(cstyle.fg_set) {
                 char buf[8];
-                snprintf(buf, 8, "#%02X%02X%02X", (int)style.fg.red, (int)style.fg.green, (int)style.fg.blue);
+                snprintf(buf, 8, "#%02X%02X%02X", (int)cstyle.fg.red, (int)cstyle.fg.green, (int)cstyle.fg.blue);
                 
                 GValue style_fg_value = G_VALUE_INIT;
                 g_value_init(&style_fg_value, G_TYPE_STRING);
@@ -2489,7 +2496,11 @@
         
         UIMENU menu = data->customdata3;
         g_object_set_data(G_OBJECT(button), "ui-button-popup", menu);
+#if GTK_CHECK_VERSION(4, 0, 0)
         gtk_popover_popup(GTK_POPOVER(menu));
+#else
+        ui_contextmenu_popup(menu, button, 0, 0);
+#endif
     }
 }
 
@@ -2581,6 +2592,7 @@
                 event
                 );
         gtk_widget_set_visible(button, FALSE);
+        WIDGET_NO_SHOW_ALL(button);
         
         g_object_set_data(G_OBJECT(row), "ui-listbox-row-button", button);
         
@@ -2620,6 +2632,7 @@
     LISTBOX_ROW_REMOVE_CHILD(row);
     
     listbox_fill_row(listbox, GTK_WIDGET(row), sublist, &item, index);
+    LISTBOX_ROW_SHOW(row);
     
      // cleanup
     free(item.label);
@@ -2756,6 +2769,7 @@
 #endif
         
         listbox_fill_row(listbox, row, sublist, &item, index);
+        LISTBOX_ROW_SHOW(row);
         if(index == first_index) {
             // first row in the sublist, set ui_listbox data to the row
             // which is then used by the headerfunc

mercurial