Skip to content
Permalink
Browse files

Fix slightly oversized filter clear icons

And make sure on low-dpi screens the icon size is 16px for
pixel-snapped rendering of the svg
  • Loading branch information
nyalldawson committed Nov 26, 2017
1 parent a111a1c commit 60a56c372a07de9c00ab5fc820139710ec066368
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/gui/qgsfilterlineedit.cpp
@@ -32,7 +32,10 @@ QgsFilterLineEdit::QgsFilterLineEdit( QWidget *parent, const QString &nullValue
setMouseTracking( true );

QIcon clearIcon = QgsApplication::getThemeIcon( "/mIconClearText.svg" );
int iconSize = Qgis::UI_SCALE_FACTOR * fontMetrics().height();

// icon size is about 2/3 height of text, but minimum size of 16
int iconSize = std::floor( std::max( Qgis::UI_SCALE_FACTOR * fontMetrics().height() * 0.75, 16.0 ) );

mClearIconSize = QSize( iconSize, iconSize );
mClearIconPixmap = clearIcon.pixmap( mClearIconSize );
QIcon hoverIcon = QgsApplication::getThemeIcon( "/mIconClearTextHover.svg" );

0 comments on commit 60a56c3

Please sign in to comment.
You can’t perform that action at this time.