-
Committer:
Tarmac
-
Author(s):
Lars Uebernickel
-
Date:
2014-09-02 20:24:02 UTC
-
mfrom:
(1227.1.1 staging)
-
Revision ID:
tarmac-20140902202402-xo0p19dm0ai8i2tx
unitythemeiconprovider: manually load icons
Previously, UnityThemeIconProvider used QIcon::fromTheme() to lookup and load icons. That function uses fdo's default icon lookup algorithm: it looks at the current theme and all parent themes for each icon in turn. We'd prefer a breadth-first search, where all icon names are looked up in the current theme before falling back to the parent themes (see lp: #1324184). This patch implements fdo's FindBestIcon() algorithm, which behaves like that.
It also now properly support rectangular icons and always returns an icon with the requested size (adjusted for preserving the aspect ratio).
As a result, the Icon component is much simpler and only requires height to be set for rectangular icons. Fixes: https://bugs.launchpad.net/bugs/1324184.
Approved by Zsombor Egri, PS Jenkins bot.