Utils: Let FancyLineEdit have QIcons instead of QPixmaps

A QIcon contains variants for different resolutions. This change
makes sure that in a Multi-screen/mixed-scaling-mode scenario,
the right of those resolutions is chosen, depending on which screen
the line edit currently is.

Task-number: QTCREATORBUG-18869
Change-Id: I8775e9e2c9b15c2863e9415751e1306f9e43c9aa
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2017-09-05 12:59:31 +02:00
parent f4ff420036
commit 6b0b8c24b5
5 changed files with 24 additions and 30 deletions

View File

@@ -666,11 +666,11 @@ void FindToolBar::updateIcons()
bool regexp = effectiveFlags & FindRegularExpression;
bool preserveCase = effectiveFlags & FindPreserveCase;
if (!casesensitive && !wholewords && !regexp && !preserveCase) {
const QPixmap pixmap = Utils::Icons::MAGNIFIER.pixmap();
m_ui.findEdit->setButtonPixmap(Utils::FancyLineEdit::Left, pixmap);
const QIcon icon = Utils::Icons::MAGNIFIER.icon();
m_ui.findEdit->setButtonIcon(Utils::FancyLineEdit::Left, icon);
} else {
m_ui.findEdit->setButtonPixmap(Utils::FancyLineEdit::Left,
IFindFilter::pixmapForFindFlags(effectiveFlags));
m_ui.findEdit->setButtonIcon(Utils::FancyLineEdit::Left,
IFindFilter::pixmapForFindFlags(effectiveFlags));
}
}