Add support for HiDPI cursors
--HG-- branch : feature
This commit is contained in:
parent
8be71c1ecb
commit
1be3c90cd3
|
@ -560,7 +560,15 @@ void MainWindow::SetToolButtonWithApply(bool checked, Tool t, const QString &cur
|
||||||
CancelTool();
|
CancelTool();
|
||||||
emit EnableItemMove(false);
|
emit EnableItemMove(false);
|
||||||
currentTool = lastUsedTool = t;
|
currentTool = lastUsedTool = t;
|
||||||
QPixmap pixmap(cursor);
|
auto cursorResource = cursor;
|
||||||
|
if (qApp->devicePixelRatio() >= 2) {
|
||||||
|
// try to load HiDPI versions of the cursors if availible
|
||||||
|
auto cursorHidpiResource = QString(cursor).replace(".png", "@2x.png");
|
||||||
|
if (QFileInfo(cursorResource).exists()) {
|
||||||
|
cursorResource = cursorHidpiResource;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
QPixmap pixmap(cursorResource);
|
||||||
QCursor cur(pixmap, 2, 3);
|
QCursor cur(pixmap, 2, 3);
|
||||||
ui->view->setCursor(cur);
|
ui->view->setCursor(cur);
|
||||||
ui->view->setShowToolOptions(false);
|
ui->view->setShowToolOptions(false);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user