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:
parent
f8ec8cc255
commit
d8daa08359
1 changed files with 6 additions and 4 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue