Commit 3985ba53 authored by Raphael Rosch's avatar Raphael Rosch Committed by David Faure
Browse files

Fix for window icon being stretched (and ugly) when window switcher uses large icons

Summary: When using a window switcher (alt + tab) that displays larger icon versions, konqueror's window icon looks ugly due to it only using a small icon which is being stretched.

Test Plan: Patch. Compile. Run, and once running alt+tab in a window switcher set to display large icons.

Reviewers: dfaure

Reviewed By: dfaure

Tags: #konqueror

Differential Revision: https://phabricator.kde.org/D26647
parent 7d0b3c17
......@@ -4981,16 +4981,7 @@ void KonqMainWindow::addClosedWindowToUndoList()
void KonqMainWindow::updateWindowIcon()
{
const QString url = m_combo->currentText();
const QPixmap pix = KonqPixmapProvider::self()->pixmapFor(url, KIconLoader::SizeSmall);
KParts::MainWindow::setWindowIcon(pix);
QPixmap big = pix;
if (!url.isEmpty()) {
big = KonqPixmapProvider::self()->pixmapFor(url, KIconLoader::SizeMedium);
}
KWindowSystem::setIcons(winId(), big, pix);
KParts::MainWindow::setWindowIcon(KonqPixmapProvider::self()->iconForUrl(m_combo->currentText()));
}
void KonqMainWindow::slotIntro()
......
......@@ -184,3 +184,13 @@ QPixmap KonqPixmapProvider::loadIcon(const QString &icon, int size)
return QIcon::fromTheme(icon).pixmap(size);
}
QIcon KonqPixmapProvider::iconForUrl(const QUrl &url)
{
return QIcon::fromTheme(iconNameFor(url));
}
QIcon KonqPixmapProvider::iconForUrl(const QString &url_str)
{
return iconForUrl(QUrl::fromUserInput(url_str));
}
......@@ -70,6 +70,8 @@ public:
* Looks up an iconname for @p url. Uses a cache for the iconname of url.
*/
QString iconNameFor(const QUrl &url);
QIcon iconForUrl(const QUrl &url);
QIcon iconForUrl(const QString &url_str);
Q_SIGNALS:
void changed();
......
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