summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2017-09-14 19:11:53 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2017-09-18 22:18:44 (GMT)
commit89dd127a80951dcc7105c04d0e207c1561c5d8bf (patch)
tree93bcb58db49d35862142dcd587dbb022cce35890
parent283fb3633938971d04b2bf8f2b690ce9c8a83951 (diff)
downloadnetsurf-89dd127a80951dcc7105c04d0e207c1561c5d8bf.tar.gz
netsurf-89dd127a80951dcc7105c04d0e207c1561c5d8bf.tar.bz2
Treeview: Update mouse handling details for filtered view.
No moves are allowed in viltered view. Node indents are constant in filtered view.
-rw-r--r--desktop/treeview.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 7ba487a..717c90c 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -4256,14 +4256,18 @@ treeview_node_mouse_action_cb(treeview_node *node,
/* Find where the mouse is */
if (ma->y <= ma->current_y + tree_g.line_height) {
- if (ma->x >= node->inset - 1 &&
- ma->x < node->inset + tree_g.step_width) {
+ int inset = node->inset;
+ if (ma->tree->search.search == true) {
+ inset = tree_g.window_padding;
+ }
+ if (ma->x >= inset - 1 &&
+ ma->x < inset + tree_g.step_width) {
/* Over expansion toggle */
part = TV_NODE_PART_TOGGLE;
- } else if (ma->x >= node->inset + tree_g.step_width &&
- ma->x < node->inset + tree_g.step_width +
- tree_g.icon_step + node->text.width) {
+ } else if (ma->x >= inset + tree_g.step_width &&
+ ma->x < inset + tree_g.step_width +
+ tree_g.icon_step + node->text.width) {
/* On node */
part = TV_NODE_PART_ON_NODE;
}
@@ -4337,7 +4341,8 @@ treeview_node_mouse_action_cb(treeview_node *node,
treeview__cw_drag_status(ma->tree,
CORE_WINDOW_DRAG_SELECTION);
- } else if (!(ma->tree->flags & TREEVIEW_NO_MOVES) &&
+ } else if (ma->tree->search.search == false &&
+ !(ma->tree->flags & TREEVIEW_NO_MOVES) &&
ma->mouse & BROWSER_MOUSE_DRAG_1 &&
(ma->tree->drag.selected == true ||
ma->tree->drag.part == TV_NODE_PART_ON_NODE)) {
@@ -4377,7 +4382,7 @@ treeview_node_mouse_action_cb(treeview_node *node,
ma->tree->drag.prev.node_y = ma->current_y;
ma->tree->drag.prev.node_h = height;
}
- break;
+ break;
case TV_DRAG_MOVE:
redraw |= treeview_set_move_indicator(ma->tree, redraw,