Merge lp:~elementary-apps/pantheon-mail/window-icon-name into lp:~elementary-apps/pantheon-mail/trunk

Proposed by Danielle Foré
Status: Merged
Approved by: Cody Garver
Approved revision: 2075
Merged at revision: 2075
Proposed branch: lp:~elementary-apps/pantheon-mail/window-icon-name
Merge into: lp:~elementary-apps/pantheon-mail/trunk
Diff against target: 70 lines (+3/-32)
2 files modified
src/client/components/icon-factory.vala (+2/-26)
src/client/components/main-window.vala (+1/-6)
To merge this branch: bzr merge lp:~elementary-apps/pantheon-mail/window-icon-name
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+296507@code.launchpad.net

Commit message

* Set window icon name instead of loading a pixbuf
* Remove now unused const and method from icon-factory.vala

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/client/components/icon-factory.vala'
2--- src/client/components/icon-factory.vala 2015-02-06 20:43:33 +0000
3+++ src/client/components/icon-factory.vala 2016-06-05 21:38:04 +0000
4@@ -20,10 +20,7 @@
5
6 private set { _instance = value; }
7 }
8-
9- public const int APPLICATION_ICON_SIZE = 128;
10- public Gdk.Pixbuf application_icon { get; private set; }
11-
12+
13 public const int UNREAD_ICON_SIZE = 16;
14 public const int STAR_ICON_SIZE = 16;
15
16@@ -41,9 +38,6 @@
17 append_icons_search_path("48x48");
18 append_icons_search_path("24x24");
19 append_icons_search_path("16x16");
20-
21- // Load icons here.
22- application_icon = load("geary", APPLICATION_ICON_SIZE);
23 }
24
25 public void init() {
26@@ -86,25 +80,7 @@
27 else
28 icon_theme.append_search_path(icons_dir.get_child(name).get_path());
29 }
30-
31- private Gdk.Pixbuf? load(string icon_name, int size, Gtk.IconLookupFlags flags = 0) {
32- // Try looking up IconInfo (to report path in case of error) then load image
33- Gtk.IconInfo? icon_info = icon_theme.lookup_icon(icon_name, size, flags);
34- if (icon_info != null) {
35- try {
36- return icon_info.load_icon();
37- } catch (Error err) {
38- warning("Couldn't load icon %s at %s, falling back to image-missing: %s", icon_name,
39- icon_info.get_filename(), err.message);
40- }
41- } else {
42- debug("Unable to lookup icon %s, falling back to image-missing...", icon_name);
43- }
44-
45- // Default: missing image icon.
46- return get_missing_icon(size, flags);
47- }
48-
49+
50 // Attempts to load and return the missing image icon.
51 private Gdk.Pixbuf? get_missing_icon(int size, Gtk.IconLookupFlags flags = 0) {
52 try {
53
54=== modified file 'src/client/components/main-window.vala'
55--- src/client/components/main-window.vala 2016-03-13 17:51:29 +0000
56+++ src/client/components/main-window.vala 2016-06-05 21:38:04 +0000
57@@ -59,12 +59,7 @@
58 spinner.set_progress_monitor(progress_monitor);
59 progress_monitor.add(conversation_list_store.preview_monitor);
60
61- GLib.List<Gdk.Pixbuf> pixbuf_list = new GLib.List<Gdk.Pixbuf>();
62- pixbuf_list.append(IconFactory.instance.application_icon);
63- // Use copy() because set_default_icon_list() actually accepts an owned reference
64- // If we didn't hold the pixbufs in memory, would need to use copy_deep()
65- // See https://mail.gnome.org/archives/vala-list/2014-August/msg00022.html
66- set_default_icon_list(pixbuf_list.copy());
67+ icon_name = "internet-mail";
68
69 delete_event.connect(on_delete_event);
70 key_press_event.connect(on_key_press_event);

Subscribers

People subscribed via source and target branches