~tiagosh/unity-2d/fix-dash-highlights

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/cursorshapearea.cpp

  • Committer: Tiago Salem Herrmann
  • Date: 2012-03-01 19:30:49 UTC
  • mfrom: (938.1.5 unity-2d)
  • Revision ID: tiago.herrmann@canonical.com-20120301193049-yea3u2fuxs4bw7ji
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of unity-2d
 
3
 *
 
4
 * Copyright 2012 Canonical Ltd.
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; version 3.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
#include "cursorshapearea.h"
 
20
 
 
21
CursorShapeArea::CursorShapeArea(QDeclarativeItem *parent)
 
22
:   QDeclarativeItem(parent)
 
23
,   m_currentShape(Qt::ArrowCursor)
 
24
{
 
25
}
 
26
 
 
27
Qt::CursorShape CursorShapeArea::cursorShape() const
 
28
{
 
29
  return cursor().shape();
 
30
}
 
31
 
 
32
void CursorShapeArea::setCursorShape(Qt::CursorShape cursorShape)
 
33
{
 
34
  if (m_currentShape == cursorShape)
 
35
    return;
 
36
 
 
37
  setCursor(cursorShape);
 
38
  Q_EMIT cursorShapeChanged();
 
39
 
 
40
  m_currentShape = cursorShape;
 
41
}
 
42
 
 
43
#include "cursorshapearea.moc"