Merge lp:~elementary-apps/pantheon-photos/pin-toolbar-from-icon-name into lp:~pantheon-photos/pantheon-photos/trunk

Proposed by Danielle Foré
Status: Merged
Approved by: Danielle Foré
Approved revision: 2795
Merged at revision: 2792
Proposed branch: lp:~elementary-apps/pantheon-photos/pin-toolbar-from-icon-name
Merge into: lp:~pantheon-photos/pantheon-photos/trunk
Diff against target: 94 lines (+4/-23)
3 files modified
Makefile (+2/-1)
src/AppWindow.vala (+2/-1)
src/Resources.vala (+0/-21)
To merge this branch: bzr merge lp:~elementary-apps/pantheon-photos/pin-toolbar-from-icon-name
Reviewer Review Type Date Requested Status
Felipe Escoto (community) Approve
Photos Devs Pending
Review via email: mp+267460@code.launchpad.net

Commit message

* Pin Toolbar Gtk.ToggleToolButton from icon name, not stock
* Remove now unnecessary method to make pin-toolbar a stock icon
* Remove now unnecessary Gtk.IconFactory

To post a comment you must log in.
2793. By Danielle Foré

remove commented code

2794. By Danielle Foré

remove now unused gtk.iconfactory

2795. By Danielle Foré

install pin-toolbar to hicolor

Revision history for this message
Felipe Escoto (philip.scott) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2014-11-22 19:02:09 +0000
3+++ Makefile 2015-08-09 22:03:19 +0000
4@@ -171,7 +171,6 @@
5
6 ICON_FILES = \
7 drag_nub.png \
8- image-adjust.svg \
9 noninterpretable-video.png \
10 pin-toolbar.svg \
11 sprocket.png
12@@ -504,6 +503,8 @@
13 $(INSTALL_PROGRAM) $(MIGRATOR_BIN) $(DESTDIR)$(LIBEXECDIR)
14 mkdir -p $(DESTDIR)$(PREFIX)/share/shotwell/icons
15 $(INSTALL_DATA) icons/* $(DESTDIR)$(PREFIX)/share/shotwell/icons
16+ mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/actions/
17+ $(INSTALL_DATA) icons/pin-toolbar.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/actions/
18 mkdir -p $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
19 $(INSTALL_DATA) misc/org.yorba.shotwell.gschema.xml $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
20 $(INSTALL_DATA) misc/org.yorba.shotwell-extras.gschema.xml $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
21
22=== modified file 'src/AppWindow.vala'
23--- src/AppWindow.vala 2015-02-13 14:19:32 +0000
24+++ src/AppWindow.vala 2015-08-09 22:03:19 +0000
25@@ -10,7 +10,7 @@
26 public const int TOOLBAR_CHECK_DISMISSAL_MSEC = 500;
27
28 private Gtk.Window toolbar_window = new Gtk.Window (Gtk.WindowType.POPUP);
29- private Gtk.ToggleToolButton pin_button = new Gtk.ToggleToolButton.from_stock (Resources.PIN_TOOLBAR);
30+ private Gtk.ToggleToolButton pin_button = new Gtk.ToggleToolButton ();
31 private bool is_toolbar_shown = false;
32 private bool waiting_for_invoke = false;
33 private time_t left_toolbar_time = 0;
34@@ -46,6 +46,7 @@
35 set_border_width (0);
36
37 pin_button.set_label (_ ("Pin Toolbar"));
38+ pin_button.set_icon_widget (new Gtk.Image.from_icon_name ("pin-toolbar", Gtk.IconSize.LARGE_TOOLBAR));
39 pin_button.set_tooltip_text (_ ("Pin the toolbar open"));
40 pin_button.clicked.connect (update_toolbar_dismissal);
41
42
43=== modified file 'src/Resources.vala'
44--- src/Resources.vala 2015-08-08 22:40:36 +0000
45+++ src/Resources.vala 2015-08-09 22:03:19 +0000
46@@ -79,7 +79,6 @@
47 public const string STRAIGHTEN = "object-straighten";
48 public const string REDEYE = "image-red-eye";
49 public const string ADJUST = "image-adjust";
50-public const string PIN_TOOLBAR = "shotwell-pin-toolbar";
51 public const string IMPORT = "shotwell-import";
52 public const string IMPORT_ALL = "shotwell-import-all";
53 public const string ENHANCE = "image-auto-adjust";
54@@ -782,7 +781,6 @@
55 public const string SELECT_ALL_MENU = _("Select _All");
56 public const string SELECT_ALL_TOOLTIP = _("Select all items");
57
58-private Gtk.IconFactory factory = null;
59 private Gee.HashMap<string, Gdk.Pixbuf> icon_cache = null;
60 Gee.HashMap<string, Gdk.Pixbuf> scaled_icon_cache = null;
61
62@@ -794,13 +792,6 @@
63 private string START_MULTIMONTH_DATE_FORMAT_STRING = null;
64
65 public void init () {
66- // load application-wide stock icons as IconSets
67- factory = new Gtk.IconFactory ();
68-
69- File icons_dir = AppDirs.get_resources_dir ().get_child ("icons");
70- add_stock_icon (icons_dir.get_child ("pin-toolbar.svg"), PIN_TOOLBAR);
71-
72- factory.add_default ();
73
74 generate_rating_strings ();
75
76@@ -1012,18 +1003,6 @@
77 return (scale > 0) ? scale_pixbuf (pixbuf, scale, Gdk.InterpType.BILINEAR, false) : pixbuf;
78 }
79
80-private void add_stock_icon (File file, string stock_id) {
81- Gdk.Pixbuf pixbuf = null;
82- try {
83- pixbuf = new Gdk.Pixbuf.from_file (file.get_path ());
84- } catch (Error err) {
85- critical ("Unable to load stock icon %s: %s", stock_id, err.message);
86- }
87-
88- Gtk.IconSet icon_set = new Gtk.IconSet.from_pixbuf (pixbuf);
89- factory.add (stock_id, icon_set);
90-}
91-
92 public delegate void AddStockIconModify (Gdk.Pixbuf pixbuf);
93
94 // Get the directory where our help files live. Returns a string

Subscribers

People subscribed via source and target branches