From 360bc1df57fdf6a7e143e46328926f4b8630741d Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Sun, 15 Dec 2019 12:47:34 +0100 Subject: [PATCH] Show grabby hand cursors when hovering and dragging draggable widgets Summary: Same idea as D25998, but for desktop widgets and done on the C++ side to avoid weird interactions between a MouseArea and a MultiPointTouchArea on the QML side. Test Plan: {F7819381} Reviewers: #vdg, #plasma, mart, apol Reviewed By: #vdg, #plasma, mart, apol Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D26015 --- components/containmentlayoutmanager/itemcontainer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/containmentlayoutmanager/itemcontainer.cpp b/components/containmentlayoutmanager/itemcontainer.cpp index 2cf0e6b21..2cd593cc9 100644 --- a/components/containmentlayoutmanager/itemcontainer.cpp +++ b/components/containmentlayoutmanager/itemcontainer.cpp @@ -529,6 +529,7 @@ void ItemContainer::mousePressEvent(QMouseEvent *event) if (m_editMode) { grabMouse(); + setCursor(Qt::ClosedHandCursor); m_dragActive = true; emit dragActiveChanged(); } else if (m_editModeCondition == AfterPressAndHold) { @@ -562,6 +563,7 @@ void ItemContainer::mouseReleaseEvent(QMouseEvent *event) m_dragActive = false; if (m_editMode) { emit dragActiveChanged(); + setCursor(Qt::OpenHandCursor); } event->accept(); } @@ -637,6 +639,7 @@ void ItemContainer::hoverEnterEvent(QHoverEvent *event) } if (m_layout->editMode()) { + setCursor(Qt::OpenHandCursor); setEditMode(true); } else { m_editModeTimer->start(QGuiApplication::styleHints()->mousePressAndHoldInterval());