reduce icon size in completion popup

This commit is contained in:
Roy Qu 2024-04-07 09:58:30 +08:00
parent 5d20f8ed7d
commit ba6d8fa77d
1 changed files with 3 additions and 1 deletions

View File

@ -1344,7 +1344,9 @@ void CodeCompletionListItemDelegate::paint(QPainter *painter, const QStyleOption
if (option.state & QStyle::State_Selected) { if (option.state & QStyle::State_Selected) {
painter->fillRect(option.rect, mCurrentSelectionColor); painter->fillRect(option.rect, mCurrentSelectionColor);
} }
QPixmap icon = mModel->statementIcon(index, QFontMetrics(font()).height()); QFontMetrics fm{font()};
int iconSize = fm.ascent();
QPixmap icon = mModel->statementIcon(index, iconSize);
int x=option.rect.left(); int x=option.rect.left();
if (!icon.isNull()) { if (!icon.isNull()) {
qreal dpr=icon.devicePixelRatioF(); qreal dpr=icon.devicePixelRatioF();