Skip to content

Commit 62ff88a

Browse files
authored
Merge pull request #5737 from elpaso/hidpi-cursors
[bugfix][hidpi] Scalable SVG theme cursors
2 parents f6e63d7 + 656de62 commit 62ff88a

37 files changed

Lines changed: 217 additions & 330 deletions

images/images.qrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,13 @@
606606
<file>themes/default/mActionResizeSquare.svg</file>
607607
<file>themes/default/mSourceFields.svg</file>
608608
<file>flags/zh_Hant.svg</file>
609+
<file>themes/default/cursors/mCapturePoint.svg</file>
610+
<file>themes/default/cursors/mCrossHair.svg</file>
611+
<file>themes/default/cursors/mSampler.svg</file>
612+
<file>themes/default/cursors/mSelect.svg</file>
613+
<file>themes/default/cursors/mZoomIn.svg</file>
614+
<file>themes/default/cursors/mZoomOut.svg</file>
615+
<file>themes/default/cursors/mIdentify.svg</file>
609616
</qresource>
610617
<qresource prefix="/images/tips">
611618
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

python/core/qgsapplication.sip

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,26 @@ Returns the path to the default theme directory.
345345
:rtype: QIcon
346346
%End
347347

348+
enum Cursor
349+
{
350+
ZoomIn,
351+
ZoomOut,
352+
Identify,
353+
CrossHair,
354+
CapturePoint,
355+
Select,
356+
Sampler,
357+
};
358+
359+
static QCursor getThemeCursor( const Cursor &cursor );
360+
%Docstring
361+
Helper to get a theme cursor. It will fall back to the
362+
default theme if the active theme does not have the required icon.
363+
Cursors are automatically scaled to look like a 16px cursor on 96dpi
364+
screens.
365+
:rtype: QCursor
366+
%End
367+
348368
static QPixmap getThemePixmap( const QString &name );
349369
%Docstring
350370
Helper to get a theme icon as a pixmap. It will fall back to the

src/app/composer/qgscomposer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
#include "qgsproject.h"
5858
#include "qgsmapcanvas.h"
5959
#include "qgsmessageviewer.h"
60-
#include "qgscursors.h"
6160
#include "qgsmaplayeractionregistry.h"
6261
#include "qgsgeometry.h"
6362
#include "qgspaperitem.h"

0 commit comments

Comments
 (0)