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
Notes: sideshowbarker 2024-07-19 18:31:00 +09:00

View file

@ -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)