]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Remove hover highlight before opening view context menu
authorFelix Ernst <fe.a.ernst@gmail.com>
Thu, 26 May 2022 08:38:15 +0000 (10:38 +0200)
committerFelix Ernst <fe.a.ernst@gmail.com>
Fri, 27 May 2022 10:00:05 +0000 (10:00 +0000)
If one was fast to open the right-click context menu on the row of
an item in details view mode, the hover highlight would persist
while the context menu for the view was open.

This one-liner makes it so the highlight on the row is always
removed before the right-click context menu for the view is opened
so it is as clear as possible that the newly opened context menu
has no relation to the fileItem.

src/kitemviews/kitemlistcontroller.cpp

index 4d926474be451ab93e0e34b0888e6d5f1128f336..d6d276fa44eb115c3cc0b77a7ec0f927eca5ee9c 100644 (file)
@@ -1594,6 +1594,7 @@ bool KItemListController::onPress(const QPoint& screenPos, const QPointF& pos, c
                 // The selection rectangle for an item was clicked
                 Q_EMIT itemContextMenuRequested(m_pressedIndex.value(), screenPos);
             } else {
+                row->setHovered(false); // Removes the hover highlight so the context menu doesn't look like it applies to the row.
                 Q_EMIT viewContextMenuRequested(screenPos);
             }
             return true;