mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-02 00:02:12 -05:00
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
This commit is contained in:
parent
a111a1cbe4
commit
60a56c372a
@ -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" );
|
||||
|
Loading…
x
Reference in New Issue
Block a user