Merge lp:~fboucault/unity-2d/icon_fallback into lp:unity-2d

Proposed by Florian Boucault
Status: Merged
Approved by: Alberto Mardegan
Approved revision: 678
Merged at revision: 679
Proposed branch: lp:~fboucault/unity-2d/icon_fallback
Merge into: lp:unity-2d
Diff against target: 38 lines (+4/-2)
3 files modified
launcher/LauncherItem.qml (+1/-0)
launcher/LauncherList.qml (+1/-1)
places/TileVertical.qml (+2/-1)
To merge this branch: bzr merge lp:~fboucault/unity-2d/icon_fallback
Reviewer Review Type Date Requested Status
Alberto Mardegan (community) Approve
Review via email: mp+73442@code.launchpad.net

Description of the change

[dash][launcher] When an application has no icon or the icon fails to load, display a placeholder icon.

To post a comment you must log in.
Revision history for this message
Alberto Mardegan (mardy) wrote :

Tested both in places and the launcher, using the "search for file" application (which has no icon).
Works perfectly!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/LauncherItem.qml'
2--- launcher/LauncherItem.qml 2011-07-14 16:00:02 +0000
3+++ launcher/LauncherItem.qml 2011-08-30 20:59:42 +0000
4@@ -245,6 +245,7 @@
5 onWidthChanged: updateColors()
6 onHeightChanged: updateColors()
7 onSourceChanged: updateColors()
8+ onStatusChanged: if (status == Image.Error) source = "image://icons/unknown"
9
10 function updateColors() {
11 if (!item.backgroundFromIcon) return;
12
13=== modified file 'launcher/LauncherList.qml'
14--- launcher/LauncherList.qml 2011-08-10 16:57:30 +0000
15+++ launcher/LauncherList.qml 2011-08-30 20:59:42 +0000
16@@ -93,7 +93,7 @@
17 padding: list.itemPadding
18
19 desktopFile: item.desktop_file ? item.desktop_file : ""
20- icon: "image://icons/" + item.icon
21+ icon: item.icon != "" ? "image://icons/" + item.icon : "image://icons/unknown"
22 running: item.running
23 active: item.active
24 urgent: item.urgent
25
26=== modified file 'places/TileVertical.qml'
27--- places/TileVertical.qml 2011-08-25 13:08:52 +0000
28+++ places/TileVertical.qml 2011-08-30 20:59:42 +0000
29@@ -79,7 +79,8 @@
30 Image {
31 id: icon
32
33- source: iconHint != "" ? "image://icons/"+iconHint : ""
34+ source: iconHint != "" ? "image://icons/"+iconHint : "image://icons/unknown"
35+ onStatusChanged: if (status == Image.Error) source = "image://icons/unknown"
36 width: 64
37 height: 64
38 anchors.horizontalCenter: parent.horizontalCenter

Subscribers

People subscribed via source and target branches