mirror of
https://github.com/RGBCube/serenity
synced 2025-07-03 05:32:13 +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())
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue