diff options
| author | Felix Ernst <[email protected]> | 2023-11-13 17:50:24 +0100 |
|---|---|---|
| committer | Felix Ernst <[email protected]> | 2023-11-18 10:49:11 +0000 |
| commit | 046749b073422646b5ee7f5cbc1646519e471698 (patch) | |
| tree | 045bafd2e29f6980c931e08880d8c95b0a0ff7dc /src/kitemviews/kitemlistcontroller.h | |
| parent | afc47abcb8c143674ba7148cee358c02f4b0fd7a (diff) | |
Make main view react to context menu events
Before this commit, Dolphin's main view would not react to any
context menu events. It only showed context menus based on
hard-coded mouse or keyboard events i.e. mouse right-click and
presses of the "Menu" key.
This commit removes those hard-coded reactions and instead makes it
so the view shows a context menu whenever a QContextMenuEvent is
received. Therefore, a context menu will now be opened when any
platform- or system-specific context menu triggers are invoked e.g.
the Shift+F10 keyboard shortcut.
Aside from this, the only side-effect is a partial removal of an
unrelated bug: Previously, the hover highlight on items was never
cleared when the header column in details view mode was hovered.
With this commit, the hover is now correctly cleared most of the
time.
Diffstat (limited to 'src/kitemviews/kitemlistcontroller.h')
| -rw-r--r-- | src/kitemviews/kitemlistcontroller.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h index 0576fc7fd..9c3a003d3 100644 --- a/src/kitemviews/kitemlistcontroller.h +++ b/src/kitemviews/kitemlistcontroller.h @@ -24,6 +24,7 @@ class KItemListKeyboardSearchManager; class KItemListSelectionManager; class KItemListView; class KItemListWidget; +class QContextMenuEvent; class QGestureEvent; class QGraphicsSceneHoverEvent; class QGraphicsSceneDragDropEvent; @@ -313,6 +314,7 @@ private: bool mouseMoveEvent(QGraphicsSceneMouseEvent *event, const QTransform &transform); bool mouseReleaseEvent(QGraphicsSceneMouseEvent *event, const QTransform &transform); bool mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event, const QTransform &transform); + bool contextMenuEvent(QContextMenuEvent *event); bool dragEnterEvent(QGraphicsSceneDragDropEvent *event, const QTransform &transform); bool dragLeaveEvent(QGraphicsSceneDragDropEvent *event, const QTransform &transform); bool dragMoveEvent(QGraphicsSceneDragDropEvent *event, const QTransform &transform); |
