mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
[Information Panel] Adjust painting icons for high dpi scaling
Instead of creating our own KIconLoader (which takes ~5ms here) just use QIcon::fromTheme which already does everything right. BUG: 390488 Differential Revision: https://phabricator.kde.org/D10532
This commit is contained in:
parent
9a7569a82a
commit
ae67f99195
|
@ -171,11 +171,9 @@ void InformationPanelContent::showItem(const KFileItem& item)
|
||||||
if (isSearchUrl) {
|
if (isSearchUrl) {
|
||||||
// in the case of a search-URL the URL is not readable for humans
|
// in the case of a search-URL the URL is not readable for humans
|
||||||
// (at least not useful to show in the Information Panel)
|
// (at least not useful to show in the Information Panel)
|
||||||
KIconLoader iconLoader;
|
m_preview->setPixmap(
|
||||||
QPixmap icon = iconLoader.loadIcon(QStringLiteral("nepomuk"),
|
QIcon::fromTheme(QStringLiteral("nepomuk")).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous)
|
||||||
KIconLoader::NoGroup,
|
);
|
||||||
KIconLoader::SizeEnormous);
|
|
||||||
m_preview->setPixmap(icon);
|
|
||||||
} else {
|
} else {
|
||||||
// try to get a preview pixmap from the item...
|
// try to get a preview pixmap from the item...
|
||||||
|
|
||||||
|
@ -235,11 +233,9 @@ void InformationPanelContent::showItems(const KFileItemList& items)
|
||||||
m_previewJob->kill();
|
m_previewJob->kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
KIconLoader iconLoader;
|
m_preview->setPixmap(
|
||||||
QPixmap icon = iconLoader.loadIcon(QStringLiteral("dialog-information"),
|
QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous)
|
||||||
KIconLoader::NoGroup,
|
);
|
||||||
KIconLoader::SizeEnormous);
|
|
||||||
m_preview->setPixmap(icon);
|
|
||||||
setNameLabelText(i18ncp("@label", "%1 item selected", "%1 items selected", items.count()));
|
setNameLabelText(i18ncp("@label", "%1 item selected", "%1 items selected", items.count()));
|
||||||
|
|
||||||
if (m_metaDataWidget) {
|
if (m_metaDataWidget) {
|
||||||
|
@ -324,10 +320,9 @@ void InformationPanelContent::showIcon(const KFileItem& item)
|
||||||
{
|
{
|
||||||
m_outdatedPreviewTimer->stop();
|
m_outdatedPreviewTimer->stop();
|
||||||
if (!applyPlace(item.targetUrl())) {
|
if (!applyPlace(item.targetUrl())) {
|
||||||
const QPixmap icon = KIconLoader::global()->loadIcon(item.iconName(), KIconLoader::Desktop,
|
QPixmap pixmap = QIcon::fromTheme(item.iconName()).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous);
|
||||||
KIconLoader::SizeEnormous, KIconLoader::DefaultState,
|
KIconLoader::global()->drawOverlays(item.overlays(), pixmap, KIconLoader::Desktop);
|
||||||
item.overlays());
|
m_preview->setPixmap(pixmap);
|
||||||
m_preview->setPixmap(icon);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue