Skip to content

Commit 60a56c3

Browse files
committedNov 27, 2017
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
1 parent a111a1c commit 60a56c3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎src/gui/qgsfilterlineedit.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ QgsFilterLineEdit::QgsFilterLineEdit( QWidget *parent, const QString &nullValue
3232
setMouseTracking( true );
3333

3434
QIcon clearIcon = QgsApplication::getThemeIcon( "/mIconClearText.svg" );
35-
int iconSize = Qgis::UI_SCALE_FACTOR * fontMetrics().height();
35+
36+
// icon size is about 2/3 height of text, but minimum size of 16
37+
int iconSize = std::floor( std::max( Qgis::UI_SCALE_FACTOR * fontMetrics().height() * 0.75, 16.0 ) );
38+
3639
mClearIconSize = QSize( iconSize, iconSize );
3740
mClearIconPixmap = clearIcon.pixmap( mClearIconSize );
3841
QIcon hoverIcon = QgsApplication::getThemeIcon( "/mIconClearTextHover.svg" );

0 commit comments

Comments
 (0)
Please sign in to comment.