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
wilder-5.18
Nate Graham 6 years ago
parent e7af306adc
commit 360bc1df57
  1. 3
      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());

Loading…
Cancel
Save