Skip to content

Commit

Permalink
Use standard crosshair cursor in layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 7, 2018
1 parent 048db93 commit b95375a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gui/layout/qgslayoutviewtooladditem.cpp
Expand Up @@ -35,7 +35,7 @@ QgsLayoutViewToolAddItem::QgsLayoutViewToolAddItem( QgsLayoutView *view )
: QgsLayoutViewTool( view, tr( "Add item" ) )
{
setFlags( QgsLayoutViewTool::FlagSnaps );
setCursor( QgsApplication::getThemeCursor( QgsApplication::Cursor::CrossHair ) );
setCursor( Qt::CrossCursor );
}

void QgsLayoutViewToolAddItem::setItemMetadataId( int metadataId )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/layout/qgslayoutviewtooladdnodeitem.cpp
Expand Up @@ -36,7 +36,7 @@ QgsLayoutViewToolAddNodeItem::QgsLayoutViewToolAddNodeItem( QgsLayoutView *view
: QgsLayoutViewTool( view, tr( "Add item" ) )
{
setFlags( QgsLayoutViewTool::FlagSnaps );
setCursor( QgsApplication::getThemeCursor( QgsApplication::Cursor::CrossHair ) );
setCursor( Qt::CrossCursor );
}

void QgsLayoutViewToolAddNodeItem::setItemMetadataId( int metadataId )
Expand Down

7 comments on commit b95375a

@elpaso
Copy link
Contributor

@elpaso elpaso commented on b95375a Jun 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? How does it look on hidpi?

@nyalldawson
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elpaso it's a follow up to #7192

@elpaso
Copy link
Contributor

@elpaso elpaso commented on b95375a Jun 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't be better to create a variant of QgsApplication::Cursor::CrossHair and make part of the theme?

@nyalldawson
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elpaso I might be mistaken, but I thought using the qt standard cursors avoided all issues with hidpi and scaling?

@elpaso
Copy link
Contributor

@elpaso elpaso commented on b95375a Jun 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, it may depend on Qt versions + platform + your screen, on my screen I find the standard cross cursor a bit too thin but maybe it's just me.

For sure we loose control over it, I would prefer to use our custom cross-hair in all occasions or we are back to the previous situation that led to the introduction of our themable cursors in the first place.

So, this is what I suggest:

  • if QgsApplication::Cursor::CrossHair does not look good fix it instead of replacing it
  • always use QgsApplication::Cursor::CrossHair unless it does not look good in that particular situation: in that case, create another QgsApplication::Cursor that suit the need

This of course would also apply to #7192

@nyalldawson
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with always using a custom one, so long as we're consistent with it and never use the standard one

@elpaso
Copy link
Contributor

@elpaso elpaso commented on b95375a Jun 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 just be consistent.

Please sign in to comment.