Commit cb085066 authored by Méven Car's avatar Méven Car
Browse files

Information Panel: Make icons as big as previews

Summary:
Make icons match the preview size.
It prevents a user that had a wide information panel,
seeing a size difference between a preview and an icon despite they can look similar (i.e folder preview).

Test Plan:
Before:
{F8248373, size=full}

After:
{F8248370, size=full}

Reviewers: #dolphin, ngraham, elvisangelaccio

Reviewed By: #dolphin, ngraham, elvisangelaccio

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D29002
parent bb48d4f1
...@@ -233,7 +233,7 @@ void InformationPanelContent::refreshPreview() ...@@ -233,7 +233,7 @@ void InformationPanelContent::refreshPreview()
// 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)
m_preview->setPixmap( m_preview->setPixmap(
QIcon::fromTheme(QStringLiteral("baloo")).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous) QIcon::fromTheme(QStringLiteral("baloo")).pixmap(m_preview->height(), m_preview->width())
); );
} else { } else {
...@@ -314,7 +314,7 @@ void InformationPanelContent::showItems(const KFileItemList& items) ...@@ -314,7 +314,7 @@ void InformationPanelContent::showItems(const KFileItemList& items)
m_preview->stopAnimatedImage(); m_preview->stopAnimatedImage();
m_preview->setPixmap( m_preview->setPixmap(
QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous) QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(m_preview->height(), m_preview->width())
); );
setNameLabelText(i18ncp("@label", "%1 item selected", "%1 items selected", items.count())); setNameLabelText(i18ncp("@label", "%1 item selected", "%1 items selected", items.count()));
...@@ -358,7 +358,7 @@ bool InformationPanelContent::eventFilter(QObject* obj, QEvent* event) ...@@ -358,7 +358,7 @@ bool InformationPanelContent::eventFilter(QObject* obj, QEvent* event)
void InformationPanelContent::showIcon(const KFileItem& item) void InformationPanelContent::showIcon(const KFileItem& item)
{ {
m_outdatedPreviewTimer->stop(); m_outdatedPreviewTimer->stop();
QPixmap pixmap = QIcon::fromTheme(item.iconName()).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous); QPixmap pixmap = QIcon::fromTheme(item.iconName()).pixmap(m_preview->height(), m_preview->width());
KIconLoader::global()->drawOverlays(item.overlays(), pixmap, KIconLoader::Desktop); KIconLoader::global()->drawOverlays(item.overlays(), pixmap, KIconLoader::Desktop);
m_preview->setPixmap(pixmap); m_preview->setPixmap(pixmap);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment