summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2014-02-25 23:37:06 +1100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-26 12:58:00 +0100
commit66e5f8e9dcd11d136b707d13c7597019c99c54b8 (patch)
treea689c0995d9af189c6ab88354aa1a92bbe4f3f68
parentcea3f4d5357ae4417ff3624ecca32f9cd5d4c260 (diff)
eglfs: Improve cursors and hotspots
Improvements * Cursor atlas has been recreated using 32x32 cursors which avoids artifacts introduced from downscaling of the busy cursor * A white outline has been added to the cursors to improve visibility on black backgrounds * Hot spot positions have been tweaked; in particular, Qt::PointingHandCursor now has a correct hot spot at the tip of the index finger instead of the center The assert which checks that the number of hot spots equals the number of cursors had an off-by-one error as the first cursor is Qt::ArrowCursor which has an enum value of 0. To determine the number of cursors, 1 needs to be added to Qt::LastCursor. Change-Id: I266b6d4cc47d42219854aa5b7e2d8344eb3a920a Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcursor.cpp4
-rwxr-xr-x[-rw-r--r--]src/plugins/platforms/eglfs/cursor-atlas.pngbin2735 -> 2928 bytes
-rw-r--r--src/plugins/platforms/eglfs/cursor.json42
3 files changed, 23 insertions, 23 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformcursor.cpp b/src/platformsupport/eglconvenience/qeglplatformcursor.cpp
index 1c87e1d27d..70e7c4e4db 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcursor.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformcursor.cpp
@@ -210,7 +210,7 @@ void QEGLPlatformCursor::initCursorAtlas()
m_cursorAtlas.cursorsPerRow = cursorsPerRow;
const QJsonArray hotSpots = object.value(QLatin1String("hotSpots")).toArray();
- Q_ASSERT(hotSpots.count() == Qt::LastCursor);
+ Q_ASSERT(hotSpots.count() == Qt::LastCursor + 1);
for (int i = 0; i < hotSpots.count(); i++) {
QPoint hotSpot(hotSpots[i].toArray()[0].toDouble(), hotSpots[i].toArray()[1].toDouble());
m_cursorAtlas.hotSpots << hotSpot;
@@ -218,7 +218,7 @@ void QEGLPlatformCursor::initCursorAtlas()
QImage image = QImage(atlas).convertToFormat(QImage::Format_ARGB32_Premultiplied);
m_cursorAtlas.cursorWidth = image.width() / m_cursorAtlas.cursorsPerRow;
- m_cursorAtlas.cursorHeight = image.height() / ((Qt::LastCursor + cursorsPerRow - 1) / cursorsPerRow);
+ m_cursorAtlas.cursorHeight = image.height() / ((Qt::LastCursor + cursorsPerRow) / cursorsPerRow);
m_cursorAtlas.width = image.width();
m_cursorAtlas.height = image.height();
m_cursorAtlas.image = image;
diff --git a/src/plugins/platforms/eglfs/cursor-atlas.png b/src/plugins/platforms/eglfs/cursor-atlas.png
index 8d89a7ab86..4ddb7708e1 100644..100755
--- a/src/plugins/platforms/eglfs/cursor-atlas.png
+++ b/src/plugins/platforms/eglfs/cursor-atlas.png
Binary files differ
diff --git a/src/plugins/platforms/eglfs/cursor.json b/src/plugins/platforms/eglfs/cursor.json
index 7b6b6d95fa..307d5cf6cd 100644
--- a/src/plugins/platforms/eglfs/cursor.json
+++ b/src/plugins/platforms/eglfs/cursor.json
@@ -3,26 +3,26 @@
"cursorsPerRow": 8,
"hotSpots": [
[7, 2],
- [13, 3],
- [13, 13],
- [13, 13],
- [14, 15],
- [13, 13],
- [13, 13],
- [13, 13],
- [13, 13],
- [13, 13],
- [13, 13],
- [13, 13],
- [13, 13],
- [13, 13],
- [13, 13],
- [10, 1],
- [13, 13],
- [0, 0],
- [0, 0],
- [13, 13],
- [13, 13]
+ [12, 3],
+ [12, 12],
+ [12, 12],
+ [12, 12],
+ [12, 12],
+ [12, 12],
+ [12, 12],
+ [12, 12],
+ [11, 11],
+ [12, 12],
+ [12, 12],
+ [12, 12],
+ [9, 1],
+ [12, 12],
+ [1, 1],
+ [1, 1],
+ [12, 12],
+ [12, 12],
+ [12, 12],
+ [12, 12],
+ [12, 12]
]
}
-