Fixed iconsize issue with fontmetrics on macos

This commit is contained in:
defnax 2024-02-03 23:26:25 +01:00
parent 8564a22bef
commit ae24db1da0

View File

@ -234,8 +234,10 @@ void LineEditClear::setFilterButtonIcon(const QIcon &icon)
mFilterButton->setIcon(icon); mFilterButton->setIcon(icon);
ensurePolished(); ensurePolished();
#if !defined(Q_OS_DARWIN)
QFontMetrics fm(this->font()); QFontMetrics fm(this->font());
QSize size(fm.width("___"), fm.height()); QSize size(fm.width("___"), fm.height());
mFilterButton->setFixedSize(size); mFilterButton->setFixedSize(size);
mFilterButton->setIconSize(size); mFilterButton->setIconSize(size);
#endif
} }