~dandrader/unity8/pixelAlignedWindow

« back to all changes in this revision

Viewing changes to plugins/Cursor/MousePointer.cpp

  • Committer: Daniel d'Andrada
  • Date: 2016-05-19 19:44:37 UTC
  • Revision ID: daniel.dandrada@canonical.com-20160519194437-c6yx7w7872eu4z7i
SupportĀ animatedĀ cursors

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    : MirMousePointerInterface(parent)
30
30
    , m_cursorName(QStringLiteral("left_ptr"))
31
31
    , m_themeName(QStringLiteral("default"))
32
 
    , m_hotspotX(0)
33
 
    , m_hotspotY(0)
34
32
{
35
 
    updateHotspot();
36
33
}
37
34
 
38
35
void MousePointer::handleMouseEvent(ulong timestamp, QPointF movement, Qt::MouseButtons buttons,
115
112
    if (cursorName != m_cursorName) {
116
113
        m_cursorName = cursorName;
117
114
        Q_EMIT cursorNameChanged(m_cursorName);
118
 
        updateHotspot();
119
 
    }
120
 
}
121
 
 
122
 
void MousePointer::updateHotspot()
123
 
{
124
 
    QPoint newHotspot = CursorImageProvider::instance()->hotspot(m_themeName, m_cursorName);
125
 
 
126
 
    if (m_hotspotX != newHotspot.x()) {
127
 
        m_hotspotX = newHotspot.x();
128
 
        Q_EMIT hotspotXChanged(m_hotspotX);
129
 
    }
130
 
 
131
 
    if (m_hotspotY != newHotspot.y()) {
132
 
        m_hotspotY = newHotspot.y();
133
 
        Q_EMIT hotspotYChanged(m_hotspotY);
134
115
    }
135
116
}
136
117