Merge lp:~aacid/unity-2d/icon_change_update into lp:unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 1112
Merged at revision: 1111
Proposed branch: lp:~aacid/unity-2d/icon_change_update
Merge into: lp:unity-2d
Diff against target: 121 lines (+29/-1)
5 files modified
shell/app/shellmanager.cpp (+8/-0)
shell/app/shellmanager.h (+3/-0)
shell/common/IconTile.qml (+1/-0)
shell/launcher/LauncherItem.qml (+11/-1)
tests/manual-tests/launcher.txt (+6/-0)
To merge this branch: bzr merge lp:~aacid/unity-2d/icon_change_update
Reviewer Review Type Date Requested Status
Gerry Boland Pending
Review via email: mp+107808@code.launchpad.net

Commit message

[shell] Refresh icon tiles on theme change

Description of the change

[shell] Refresh icon tiles on theme change

To post a comment you must log in.
1112. By Albert Astals Cid

test

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shell/app/shellmanager.cpp'
2--- shell/app/shellmanager.cpp 2012-04-26 08:14:26 +0000
3+++ shell/app/shellmanager.cpp 2012-05-29 15:24:19 +0000
4@@ -62,6 +62,7 @@
5 static const char* HUD_SHORTCUT_KEY = "/apps/compiz-1/plugins/unityshell/screen0/options/show_hud";
6
7 GOBJECT_CALLBACK1(activeWorkspaceChangedCB, "onActiveWorkspaceChanged");
8+GOBJECT_CALLBACK0(iconThemeChangedCB, "onIconThemeChanged");
9
10 struct ShellManagerPrivate
11 {
12@@ -334,11 +335,13 @@
13 updateDashAlwaysFullScreen();
14
15 g_signal_connect(G_OBJECT(wnck_screen_get_default()), "active_workspace_changed", G_CALLBACK(activeWorkspaceChangedCB), this);
16+ g_signal_connect(G_OBJECT(gtk_icon_theme_get_default()), "changed", G_CALLBACK(iconThemeChangedCB), this);
17 }
18
19 ShellManager::~ShellManager()
20 {
21 g_signal_handlers_disconnect_by_func(G_OBJECT(wnck_screen_get_default()), gpointer(activeWorkspaceChangedCB), this);
22+ g_signal_handlers_disconnect_by_func(G_OBJECT(gtk_icon_theme_get_default()), gpointer(iconThemeChangedCB), this);
23
24 qDeleteAll(d->m_viewList);
25 delete d;
26@@ -492,6 +495,11 @@
27 Q_EMIT lastFocusedWindowChanged(d->m_last_focused_window);
28 }
29
30+void ShellManager::onIconThemeChanged()
31+{
32+ Q_EMIT iconThemeChanged();
33+}
34+
35 void ShellManager::onHudActivationShortcutChanged()
36 {
37 // TODO It might make sense to abstract this logic
38
39=== modified file 'shell/app/shellmanager.h'
40--- shell/app/shellmanager.h 2012-04-02 14:03:32 +0000
41+++ shell/app/shellmanager.h 2012-05-29 15:24:19 +0000
42@@ -101,6 +101,7 @@
43 void dashActivateHome();
44 void dashActivateLens(const QString& lensId);
45 void toggleHud();
46+ void iconThemeChanged();
47
48 private Q_SLOTS:
49 void onScreenCountChanged(int);
50@@ -119,6 +120,8 @@
51
52 void onHudActivationShortcutChanged();
53
54+ void onIconThemeChanged();
55+
56 private:
57 Q_DISABLE_COPY(ShellManager)
58 ShellManagerPrivate * const d;
59
60=== modified file 'shell/common/IconTile.qml'
61--- shell/common/IconTile.qml 2012-04-03 15:11:46 +0000
62+++ shell/common/IconTile.qml 2012-05-29 15:24:19 +0000
63@@ -70,6 +70,7 @@
64
65 sourceSize.width: 48
66 sourceSize.height: 48
67+ cache: false
68
69 /* Whenever one of the parameters used in calculating the background color of
70 the icon changes, recalculate its value */
71
72=== modified file 'shell/launcher/LauncherItem.qml'
73--- shell/launcher/LauncherItem.qml 2012-04-18 16:33:22 +0000
74+++ shell/launcher/LauncherItem.qml 2012-05-29 15:24:19 +0000
75@@ -197,6 +197,8 @@
76
77 /* This draws the icon, the tile background and the sheen on top */
78 IconTile {
79+ property bool refreshingIcon: false
80+
81 id: icon
82 width: item.tileSize
83 height: item.tileSize
84@@ -205,7 +207,7 @@
85 activeFocus: declarativeView.focus && item.activeFocus
86 backgroundFromIcon: item.backgroundFromIcon
87
88- source: (beHudItem && hudLoader) ? hudLoader.item.appIcon : item.icon
89+ source: refreshingIcon ? "image://icons/unknown" : ((beHudItem && hudLoader) ? hudLoader.item.appIcon : item.icon)
90 tileBackgroundImage: (item.isBfb) ? "../launcher/artwork/squircle_base_54.png" : ""
91 tileShineImage: (item.isBfb) ? "../launcher/artwork/squircle_shine_54.png" : ""
92 selectedTileBackgroundImage: (item.isBfb) ? "../launcher/artwork/squircle_base_selected_54.png" : ""
93@@ -219,6 +221,14 @@
94 alwaysRunToEnd: true
95 running: launching
96 }
97+
98+ Connections {
99+ target: shellManager
100+ onIconThemeChanged: {
101+ icon.refreshingIcon = true
102+ icon.refreshingIcon = false
103+ }
104+ }
105 }
106
107 /* This image appears only while launching, and pulses in and out in counterpoint
108
109=== modified file 'tests/manual-tests/launcher.txt'
110--- tests/manual-tests/launcher.txt 2012-05-25 07:20:58 +0000
111+++ tests/manual-tests/launcher.txt 2012-05-29 15:24:19 +0000
112@@ -190,3 +190,9 @@
113
114 Verify there is no "Unity 2d Shell" tile in the launcher
115 ----
116+ * Open a terminal
117+ * Open the system settings
118+ * Change the icon theme from Ambience to High Constrast
119+
120+Verify the icon of the terminal is updated
121+----

Subscribers

People subscribed via source and target branches