2021-03-05 02:35:15 +03:00
|
|
|
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-02-14 03:28:28 +03:00
|
|
|
#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();
|
|
|
|
}
|