summary refs log tree commit diff
path: root/src/ui/NhekoCursorShape.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/NhekoCursorShape.cpp')
-rw-r--r--src/ui/NhekoCursorShape.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ui/NhekoCursorShape.cpp b/src/ui/NhekoCursorShape.cpp
new file mode 100644

index 00000000..06b0a321 --- /dev/null +++ b/src/ui/NhekoCursorShape.cpp
@@ -0,0 +1,25 @@ +#include "NhekoCursorShape.h" + +#include <QCursor> + +NhekoCursorShape::NhekoCursorShape(QQuickItem *parent) + : QQuickItem(parent) + , currentShape_(Qt::CursorShape::ArrowCursor) +{} + +Qt::CursorShape +NhekoCursorShape::cursorShape() const +{ + return cursor().shape(); +} + +void +NhekoCursorShape::setCursorShape(Qt::CursorShape cursorShape) +{ + if (currentShape_ == cursorShape) + return; + + currentShape_ = cursorShape; + setCursor(cursorShape); + emit cursorShapeChanged(); +}