Skip to content

Commit 3b933f5

Browse files
committedNov 28, 2017
[hidpi] New icons and bigger cursors
Cursors are now approximately 24x24 pixels on 96dpi
1 parent 4705da3 commit 3b933f5

File tree

8 files changed

+18
-599
lines changed

8 files changed

+18
-599
lines changed
 
Lines changed: 1 addition & 1 deletion

Error rendering embedded code

Invalid image source.

Lines changed: 1 addition & 63 deletions

Error rendering embedded code

Invalid image source.

Lines changed: 1 addition & 95 deletions

Error rendering embedded code

Invalid image source.

Lines changed: 1 addition & 112 deletions

Error rendering embedded code

Invalid image source.

Lines changed: 1 addition & 68 deletions

Error rendering embedded code

Invalid image source.

Lines changed: 1 addition & 127 deletions

Error rendering embedded code

Invalid image source.

Lines changed: 1 addition & 128 deletions

Error rendering embedded code

Invalid image source.

‎src/core/qgsapplication.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,13 +497,17 @@ QCursor QgsApplication::getThemeCursor( const Cursor &cursor )
497497
{
498498
case ZoomIn:
499499
name = QStringLiteral( "mZoomIn.svg" );
500+
activeX = 13;
501+
activeY = 13;
500502
break;
501503
case ZoomOut:
502504
name = QStringLiteral( "mZoomOut.svg" );
505+
activeX = 13;
506+
activeY = 13;
503507
break;
504508
case Identify:
505-
activeX = 0;
506-
activeY = 0;
509+
activeX = 3;
510+
activeY = 6;
507511
name = QStringLiteral( "mIdentify.svg" );
508512
break;
509513
case CrossHair:
@@ -514,10 +518,12 @@ QCursor QgsApplication::getThemeCursor( const Cursor &cursor )
514518
break;
515519
case Select:
516520
name = QStringLiteral( "mSelect.svg" );
521+
activeX = 6;
522+
activeY = 6;
517523
break;
518524
case Sampler:
519-
activeX = 0;
520-
activeY = 0;
525+
activeX = 5;
526+
activeY = 5;
521527
name = QStringLiteral( "mSampler.svg" );
522528
break;
523529
// No default
@@ -531,7 +537,7 @@ QCursor QgsApplication::getThemeCursor( const Cursor &cursor )
531537
if ( ! icon.isNull( ) )
532538
{
533539
// Apply scaling
534-
float scale( ( float ) app->fontMetrics().height() / 32 );
540+
float scale( ( float ) app->fontMetrics().height() / 32 * 1.5 ) ; // Make them bigger to match 24x24
535541
_cursor = QCursor( icon.pixmap( std::ceil( scale * 32 ), std::ceil( scale * 32 ) ), std::ceil( scale * activeX ), std::ceil( scale * activeY ) );
536542
}
537543
if ( app )

3 commit comments

Comments
 (3)

m-kuhn commented on Dec 12, 2017

@m-kuhn
Member

@elpaso do you think there's a possibility to have scalable cursors? They are now huge on non-hidpi screens

wonder-sk commented on Dec 12, 2017

@wonder-sk
Member

To be honest they seem a bit large also on my hidpi screen :-) (e.g. identify tool's arrow cursor is ~2x size of my system arrow cursor)

elpaso commented on Dec 12, 2017

@elpaso
ContributorAuthor

Let's drop the 1.5 then

Please sign in to comment.