diff options
author | remyabel <47402505+remyabel@users.noreply.github.com> | 2019-12-10 04:24:14 -0500 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-12-10 10:24:14 +0100 |
commit | d8daa0835984be05f6cdf4beca06028355c48b0e (patch) | |
tree | 3d9e2c6fe61660ea10dad20c04a7d57a302c723c | |
parent | f8ec8cc255ff3c113137e014c3cfd8a9b820a1ec (diff) | |
download | serenity-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.cpp | 10 |
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) |