diff options
author | Bill Haneman <billh@src.gnome.org> | 2004-08-26 14:12:31 +0000 |
---|---|---|
committer | Bill Haneman <billh@src.gnome.org> | 2004-08-26 14:12:31 +0000 |
commit | 3124567f18e3d2d59995eabd933cc4359215f530 (patch) | |
tree | db8d935d3da72496ac32a7edf807e1c533426160 /gtk | |
parent | c429b89d563c4a59c62359704b5eaaf9aee234cc (diff) | |
download | gtk+-3124567f18e3d2d59995eabd933cc4359215f530.tar.gz |
Fix for #131226, allow selection of singleton list items in multi-select
lists, via keyboard. [on behalf of Padraig O'Briain]
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtktreeview.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 3530144ddc..e4c81feeb9 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -8378,6 +8378,31 @@ gtk_tree_view_move_cursor_up_down (GtkTreeView *tree_view, _gtk_rbtree_next_full (cursor_tree, cursor_node, &new_cursor_tree, &new_cursor_node); + /* + * If the list has only one item and multi-selection is set then select + * the row. + */ + if (tree_view->priv->selection->type == GTK_SELECTION_MULTIPLE && + new_cursor_node == NULL) + { + if (count == -1) + _gtk_rbtree_next_full (cursor_tree, cursor_node, + &new_cursor_tree, &new_cursor_node); + else + _gtk_rbtree_prev_full (cursor_tree, cursor_node, + &new_cursor_tree, &new_cursor_node); + + if (new_cursor_node == NULL) + { + new_cursor_node = cursor_node; + new_cursor_tree = cursor_tree; + } + else + { + new_cursor_node = NULL; + } + } + if (new_cursor_node) { cursor_path = _gtk_tree_view_find_path (tree_view, new_cursor_tree, new_cursor_node); |