From 046749b073422646b5ee7f5cbc1646519e471698 Mon Sep 17 00:00:00 2001 From: Felix Ernst Date: Mon, 13 Nov 2023 17:50:24 +0100 Subject: 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. --- src/kitemviews/kitemlistview.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/kitemviews/kitemlistview.cpp') diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index cf1483659..89376ab20 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -402,6 +402,10 @@ qreal KItemListView::verticalPageStep() const std::optional KItemListView::itemAt(const QPointF &pos) const { + if (headerBoundaries().contains(pos)) { + return std::nullopt; + } + QHashIterator it(m_visibleItems); while (it.hasNext()) { it.next(); -- cgit v1.3.1