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();
|
||||
emit EnableItemMove(false);
|
||||
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);
|
||||
ui->view->setCursor(cur);
|
||||
ui->view->setShowToolOptions(false);
|
||||
|
|
Loading…
Reference in New Issue
Block a user