summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2017-09-09 20:24:29 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2017-09-10 14:53:15 (GMT)
commit3a02a4ea484685e5fce9c6c77f521670959d926b (patch)
tree1991e0af170a357b6b7bfdca7fac935e5521d780
parentadbcb7f1b904c1a725fab4be7323a350f9ce02a8 (diff)
downloadnetsurf-3a02a4ea484685e5fce9c6c77f521670959d926b.tar.gz
netsurf-3a02a4ea484685e5fce9c6c77f521670959d926b.tar.bz2
Treeview: Handle mouse clicks on search bar.
-rw-r--r--desktop/treeview.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 5c0d05c..a460f4d 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -3981,6 +3981,23 @@ treeview_mouse_action(treeview *tree, browser_mouse_state mouse, int x, int y)
textarea_mouse_action(tree->edit.textarea, mouse,
x - tree->edit.x, y - tree->edit.y);
return;
+ } else if (tree->drag.type == TV_DRAG_SEARCH || y < search_height) {
+ if (tree->search.active == false) {
+ tree->search.active = true;
+ if (treeview_clear_selection(tree, &r)) {
+ cw_invalidate_area(tree, &r);
+ }
+ }
+ textarea_mouse_action(tree->search.textarea, mouse,
+ x - tree_g.window_padding - tree_g.icon_size,
+ y);
+ return;
+ } else if (mouse & (BROWSER_MOUSE_PRESS_1 | BROWSER_MOUSE_PRESS_2) &&
+ tree->search.active == true) {
+
+ tree->search.active = false;
+ textarea_set_caret(tree->search.textarea, -1);
+ return;
}
/* Handle textarea related mouse action */