summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorremyabel <47402505+remyabel@users.noreply.github.com>2019-12-10 04:24:14 -0500
committerAndreas Kling <awesomekling@gmail.com>2019-12-10 10:24:14 +0100
commitd8daa0835984be05f6cdf4beca06028355c48b0e (patch)
tree3d9e2c6fe61660ea10dad20c04a7d57a302c723c
parentf8ec8cc255ff3c113137e014c3cfd8a9b820a1ec (diff)
downloadserenity-d8daa0835984be05f6cdf4beca06028355c48b0e.zip
GTreeView: Prevent doubleclick with right mouse button (#868)
This follows user expectations and prevents interference with context menu handling.
-rw-r--r--Libraries/LibGUI/GTreeView.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Libraries/LibGUI/GTreeView.cpp b/Libraries/LibGUI/GTreeView.cpp
index 716eaccda8..c363a9ea28 100644
--- a/Libraries/LibGUI/GTreeView.cpp
+++ b/Libraries/LibGUI/GTreeView.cpp
@@ -94,11 +94,13 @@ void GTreeView::doubleclick_event(GMouseEvent& event)
if (!index.is_valid())
return;
- if (selection().first() != index)
- selection().set(index);
+ if (event.button() == GMouseButton::Left) {
+ if (selection().first() != index)
+ selection().set(index);
- if (model.row_count(index))
- toggle_index(index);
+ if (model.row_count(index))
+ toggle_index(index);
+ }
}
void GTreeView::toggle_index(const GModelIndex& index)