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

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

Details

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.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
rrosch requested review of this revision.Jan 14 2020, 12:48 AM
rrosch created this revision.
dfaure requested changes to this revision.Jan 15 2020, 9:46 PM
dfaure added inline comments.
src/konqmainwindow.cpp
4989

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));
KParts::MainWindow::setWindowIcon(icon);

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.Jan 15 2020, 9:46 PM
rrosch updated this revision to Diff 73743.Jan 17 2020, 2:23 AM

Implemented the changes suggested by dfaure.

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

Thanks.

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.Jan 17 2020, 8:40 AM
dfaure closed this revision.Jan 19 2020, 10:15 AM