1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 01:47:36 +00:00

GTreeView: Prevent doubleclick with right mouse button (#868)

This follows user expectations and prevents interference with context menu
handling.
This commit is contained in:
remyabel 2019-12-10 04:24:14 -05:00 committed by Andreas Kling
parent f8ec8cc255
commit d8daa08359

View file

@ -94,11 +94,13 @@ void GTreeView::doubleclick_event(GMouseEvent& event)
if (!index.is_valid()) if (!index.is_valid())
return; return;
if (selection().first() != index) if (event.button() == GMouseButton::Left) {
selection().set(index); if (selection().first() != index)
selection().set(index);
if (model.row_count(index)) if (model.row_count(index))
toggle_index(index); toggle_index(index);
}
} }
void GTreeView::toggle_index(const GModelIndex& index) void GTreeView::toggle_index(const GModelIndex& index)