Merge lp:~mterry/ubuntu-app-launch/default-themes into lp:ubuntu-app-launch

Proposed by Michael Terry on 2017-03-03
Status: Rejected
Rejected by: Michael Terry on 2017-03-30
Proposed branch: lp:~mterry/ubuntu-app-launch/default-themes
Merge into: lp:ubuntu-app-launch
Diff against target: 31 lines (+14/-0)
1 file modified
libubuntu-app-launch/application-icon-finder.cpp (+14/-0)
To merge this branch: bzr merge lp:~mterry/ubuntu-app-launch/default-themes
Reviewer Review Type Date Requested Status
Ted Gould (community) 2017-03-03 Approve on 2017-03-07
unity-api-1-bot continuous-integration Needs Fixing on 2017-03-04
Review via email: mp+318965@code.launchpad.net

Commit Message

Look in Adwaita and gnome icon themes as well as hicolor and Humanity for fallbacks.

Description of the Change

Run "ubuntu-app-info gucharmap" before and after to see amazing results!

GTK+ uses Adwaita, gnome, and hicolor as icon fallbacks [1]. We should probably match that behavior, else some apps on the desktop don't show icons (like gucharmap).

[1] https://git.gnome.org/browse/gtk+/tree/gtk/gtkicontheme.c#n1331

To post a comment you must log in.
Michael Terry (mterry) wrote :

Do we want to look at suru too?

unity-api-1-bot (unity-api-1-bot) wrote :
review: Needs Fixing (continuous-integration)
dobey (dobey) wrote :

I'm not sure what to say about this right now. It seems we don't really handle icon themes at all under Unity8, which is very unfortunate. Should we actually handle themes?

Ted Gould (ted) wrote :

I think that's a larger question. For now this fixes the issue of a broken ISO, which is an immediate need. If we want to do more theming in the future is different question.

review: Approve
Michael Terry (mterry) wrote :

Unmerged revisions

295. By Michael Terry on 2017-03-03

Look in Adwaita and gnome icon themes too

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libubuntu-app-launch/application-icon-finder.cpp'
2--- libubuntu-app-launch/application-icon-finder.cpp 2017-01-10 18:41:25 +0000
3+++ libubuntu-app-launch/application-icon-finder.cpp 2017-03-03 22:05:22 +0000
4@@ -29,6 +29,8 @@
5 constexpr auto ICONS_DIR = "/icons";
6 constexpr auto HICOLOR_THEME_DIR = "/icons/hicolor";
7 constexpr auto HUMANITY_THEME_DIR = "/icons/Humanity";
8+constexpr auto ADWAITA_THEME_DIR = "/icons/Adwaita";
9+constexpr auto GNOME_THEME_DIR = "/icons/gnome";
10 constexpr auto THEME_INDEX_FILE = "index.theme";
11 constexpr auto APPLICATIONS_TYPE = "Applications";
12 constexpr auto SIZE_PROPERTY = "Size";
13@@ -347,6 +349,18 @@
14 iconPaths.splice(iconPaths.end(), humanityIcons);
15 g_free(humanityDir);
16
17+ /* Icons from the Adwaita theme (gtk looks here by default, so lets match its behavior) */
18+ auto adwaitaDir = g_build_filename(basePath.c_str(), ADWAITA_THEME_DIR, nullptr);
19+ auto adwaitaIcons = iconsFromThemePath(adwaitaDir);
20+ iconPaths.splice(iconPaths.end(), adwaitaIcons);
21+ g_free(adwaitaDir);
22+
23+ /* Icons from the gnome theme (gtk looks here by default, so lets match its behavior) */
24+ auto gnomeDir = g_build_filename(basePath.c_str(), GNOME_THEME_DIR, nullptr);
25+ auto gnomeIcons = iconsFromThemePath(gnomeDir);
26+ iconPaths.splice(iconPaths.end(), gnomeIcons);
27+ g_free(gnomeDir);
28+
29 /* Add root icons directory as potential path */
30 auto iconsPath = g_build_filename(basePath.c_str(), ICONS_DIR, nullptr);
31 if (g_file_test(iconsPath, G_FILE_TEST_IS_DIR))

Subscribers

People subscribed via source and target branches