[zenity: 1/2] Fix search column selection with --imagelist




commit 91a6c185e9fbf03bf79e8559c3e225a8bf7afaf9
Author: Janne Pulkkinen <janne pulkkinen protonmail com>
Date:   Sat Jul 24 22:01:54 2021 +0300

    Fix search column selection with --imagelist
    
    When --imagelist is in use, use the second column as the search column,
    as is already the case with --checklist and --radiolist.
    Any searches until now would only match image path names from the first
    column.

 src/tree.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/tree.c b/src/tree.c
index d94ce7e8..634ccbf5 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -635,6 +635,14 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data) {
                                tree_data->editable);
        }
 
+       /* GTK will automatically pick the image column as the search column
+        * despite it not containing any user readable text.
+        * Set it to second column instead if it exists. */
+       if (tree_data->imagebox && n_columns > 1) {
+               gtk_tree_view_set_search_column (GTK_TREE_VIEW (tree_view),
+                       1);
+       }
+
        zenity_util_show_dialog (dialog, data->attach);
 
        if (tree_data->mid_search)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]