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
=== modified file 'shell/app/shellmanager.cpp'
--- shell/app/shellmanager.cpp 2012-04-26 08:14:26 +0000
+++ shell/app/shellmanager.cpp 2012-05-29 15:24:19 +0000
@@ -62,6 +62,7 @@
62static const char* HUD_SHORTCUT_KEY = "/apps/compiz-1/plugins/unityshell/screen0/options/show_hud";62static const char* HUD_SHORTCUT_KEY = "/apps/compiz-1/plugins/unityshell/screen0/options/show_hud";
6363
64GOBJECT_CALLBACK1(activeWorkspaceChangedCB, "onActiveWorkspaceChanged");64GOBJECT_CALLBACK1(activeWorkspaceChangedCB, "onActiveWorkspaceChanged");
65GOBJECT_CALLBACK0(iconThemeChangedCB, "onIconThemeChanged");
6566
66struct ShellManagerPrivate67struct ShellManagerPrivate
67{68{
@@ -334,11 +335,13 @@
334 updateDashAlwaysFullScreen();335 updateDashAlwaysFullScreen();
335336
336 g_signal_connect(G_OBJECT(wnck_screen_get_default()), "active_workspace_changed", G_CALLBACK(activeWorkspaceChangedCB), this);337 g_signal_connect(G_OBJECT(wnck_screen_get_default()), "active_workspace_changed", G_CALLBACK(activeWorkspaceChangedCB), this);
338 g_signal_connect(G_OBJECT(gtk_icon_theme_get_default()), "changed", G_CALLBACK(iconThemeChangedCB), this);
337}339}
338340
339ShellManager::~ShellManager()341ShellManager::~ShellManager()
340{342{
341 g_signal_handlers_disconnect_by_func(G_OBJECT(wnck_screen_get_default()), gpointer(activeWorkspaceChangedCB), this);343 g_signal_handlers_disconnect_by_func(G_OBJECT(wnck_screen_get_default()), gpointer(activeWorkspaceChangedCB), this);
344 g_signal_handlers_disconnect_by_func(G_OBJECT(gtk_icon_theme_get_default()), gpointer(iconThemeChangedCB), this);
342345
343 qDeleteAll(d->m_viewList);346 qDeleteAll(d->m_viewList);
344 delete d;347 delete d;
@@ -492,6 +495,11 @@
492 Q_EMIT lastFocusedWindowChanged(d->m_last_focused_window);495 Q_EMIT lastFocusedWindowChanged(d->m_last_focused_window);
493}496}
494497
498void ShellManager::onIconThemeChanged()
499{
500 Q_EMIT iconThemeChanged();
501}
502
495void ShellManager::onHudActivationShortcutChanged()503void ShellManager::onHudActivationShortcutChanged()
496{504{
497 // TODO It might make sense to abstract this logic505 // TODO It might make sense to abstract this logic
498506
=== modified file 'shell/app/shellmanager.h'
--- shell/app/shellmanager.h 2012-04-02 14:03:32 +0000
+++ shell/app/shellmanager.h 2012-05-29 15:24:19 +0000
@@ -101,6 +101,7 @@
101 void dashActivateHome();101 void dashActivateHome();
102 void dashActivateLens(const QString& lensId);102 void dashActivateLens(const QString& lensId);
103 void toggleHud();103 void toggleHud();
104 void iconThemeChanged();
104105
105private Q_SLOTS:106private Q_SLOTS:
106 void onScreenCountChanged(int);107 void onScreenCountChanged(int);
@@ -119,6 +120,8 @@
119120
120 void onHudActivationShortcutChanged();121 void onHudActivationShortcutChanged();
121122
123 void onIconThemeChanged();
124
122private:125private:
123 Q_DISABLE_COPY(ShellManager)126 Q_DISABLE_COPY(ShellManager)
124 ShellManagerPrivate * const d;127 ShellManagerPrivate * const d;
125128
=== modified file 'shell/common/IconTile.qml'
--- shell/common/IconTile.qml 2012-04-03 15:11:46 +0000
+++ shell/common/IconTile.qml 2012-05-29 15:24:19 +0000
@@ -70,6 +70,7 @@
7070
71 sourceSize.width: 4871 sourceSize.width: 48
72 sourceSize.height: 4872 sourceSize.height: 48
73 cache: false
7374
74 /* Whenever one of the parameters used in calculating the background color of75 /* Whenever one of the parameters used in calculating the background color of
75 the icon changes, recalculate its value */76 the icon changes, recalculate its value */
7677
=== modified file 'shell/launcher/LauncherItem.qml'
--- shell/launcher/LauncherItem.qml 2012-04-18 16:33:22 +0000
+++ shell/launcher/LauncherItem.qml 2012-05-29 15:24:19 +0000
@@ -197,6 +197,8 @@
197197
198 /* This draws the icon, the tile background and the sheen on top */198 /* This draws the icon, the tile background and the sheen on top */
199 IconTile {199 IconTile {
200 property bool refreshingIcon: false
201
200 id: icon202 id: icon
201 width: item.tileSize203 width: item.tileSize
202 height: item.tileSize204 height: item.tileSize
@@ -205,7 +207,7 @@
205 activeFocus: declarativeView.focus && item.activeFocus207 activeFocus: declarativeView.focus && item.activeFocus
206 backgroundFromIcon: item.backgroundFromIcon208 backgroundFromIcon: item.backgroundFromIcon
207209
208 source: (beHudItem && hudLoader) ? hudLoader.item.appIcon : item.icon210 source: refreshingIcon ? "image://icons/unknown" : ((beHudItem && hudLoader) ? hudLoader.item.appIcon : item.icon)
209 tileBackgroundImage: (item.isBfb) ? "../launcher/artwork/squircle_base_54.png" : ""211 tileBackgroundImage: (item.isBfb) ? "../launcher/artwork/squircle_base_54.png" : ""
210 tileShineImage: (item.isBfb) ? "../launcher/artwork/squircle_shine_54.png" : ""212 tileShineImage: (item.isBfb) ? "../launcher/artwork/squircle_shine_54.png" : ""
211 selectedTileBackgroundImage: (item.isBfb) ? "../launcher/artwork/squircle_base_selected_54.png" : ""213 selectedTileBackgroundImage: (item.isBfb) ? "../launcher/artwork/squircle_base_selected_54.png" : ""
@@ -219,6 +221,14 @@
219 alwaysRunToEnd: true221 alwaysRunToEnd: true
220 running: launching222 running: launching
221 }223 }
224
225 Connections {
226 target: shellManager
227 onIconThemeChanged: {
228 icon.refreshingIcon = true
229 icon.refreshingIcon = false
230 }
231 }
222 }232 }
223233
224 /* This image appears only while launching, and pulses in and out in counterpoint234 /* This image appears only while launching, and pulses in and out in counterpoint
225235
=== modified file 'tests/manual-tests/launcher.txt'
--- tests/manual-tests/launcher.txt 2012-05-25 07:20:58 +0000
+++ tests/manual-tests/launcher.txt 2012-05-29 15:24:19 +0000
@@ -190,3 +190,9 @@
190190
191Verify there is no "Unity 2d Shell" tile in the launcher191Verify there is no "Unity 2d Shell" tile in the launcher
192----192----
193 * Open a terminal
194 * Open the system settings
195 * Change the icon theme from Ambience to High Constrast
196
197Verify the icon of the terminal is updated
198----

Subscribers

People subscribed via source and target branches