Skip to content

Commit

Permalink
[ui][hidpi] Form line edit: compute icon size instead of hardcoding
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Nov 23, 2017
1 parent e98842e commit fe933d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/qgsfilterlineedit.cpp
Expand Up @@ -32,13 +32,14 @@ QgsFilterLineEdit::QgsFilterLineEdit( QWidget *parent, const QString &nullValue
setMouseTracking( true );

QIcon clearIcon = QgsApplication::getThemeIcon( "/mIconClearText.svg" );
mClearIconSize = QSize( 16, 16 );
int iconSize = Qgis::UI_SCALE_FACTOR * fontMetrics().height();
mClearIconSize = QSize( iconSize, iconSize );
mClearIconPixmap = clearIcon.pixmap( mClearIconSize );
QIcon hoverIcon = QgsApplication::getThemeIcon( "/mIconClearTextHover.svg" );
mClearHoverPixmap = hoverIcon.pixmap( mClearIconSize );

QIcon searchIcon = QgsApplication::getThemeIcon( "/search.svg" );
mSearchIconSize = QSize( 16, 16 );
mSearchIconSize = QSize( iconSize, iconSize );
mSearchIconPixmap = searchIcon.pixmap( mSearchIconSize );

connect( this, &QLineEdit::textChanged, this,
Expand Down

1 comment on commit fe933d2

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

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

@elpaso Fix looks good here - thanks!

Please sign in to comment.