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

Authored by rrosch on Tue, Jan 14, 12:48 AM.



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.

Diff Detail

Lint Skipped
Unit Tests Skipped
rrosch requested review of this revision.Tue, Jan 14, 12:48 AM
rrosch created this revision.
dfaure requested changes to this revision.Wed, Jan 15, 9:46 PM
dfaure added inline comments.

QPixmap is bad. This is only a workaround. setWindowIcon takes a QIcon, let's give it one.

Please test something like

const QUrl url(QUrl::fromUserInput(m_combo->currentText());
const QIcon icon = QIcon::fromTheme(KonqPixmapProvider::self()->iconNameFor(url));

Looks like it would be useful to have KonqPixmapProvider::iconForUrl() that calls QIcon::fromTheme internally, given all the code doing fromTheme(iconNameFor(u)), we could provide something more convenient.

This revision now requires changes to proceed.Wed, Jan 15, 9:46 PM
rrosch updated this revision to Diff 73743.Fri, Jan 17, 2:23 AM

Implemented the changes suggested by dfaure.

dfaure accepted this revision.Fri, Jan 17, 8:40 AM


In a followup commit, feel free to port all uses of iconNameFor to iconForUrl :-)
At least all those who simply call QIcon::fromTheme on the result.

This revision is now accepted and ready to land.Fri, Jan 17, 8:40 AM