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
=== modified file 'Makefile'
--- Makefile 2014-11-22 19:02:09 +0000
+++ Makefile 2015-08-09 22:03:19 +0000
@@ -171,7 +171,6 @@
171171
172ICON_FILES = \172ICON_FILES = \
173 drag_nub.png \173 drag_nub.png \
174 image-adjust.svg \
175 noninterpretable-video.png \174 noninterpretable-video.png \
176 pin-toolbar.svg \175 pin-toolbar.svg \
177 sprocket.png176 sprocket.png
@@ -504,6 +503,8 @@
504 $(INSTALL_PROGRAM) $(MIGRATOR_BIN) $(DESTDIR)$(LIBEXECDIR)503 $(INSTALL_PROGRAM) $(MIGRATOR_BIN) $(DESTDIR)$(LIBEXECDIR)
505 mkdir -p $(DESTDIR)$(PREFIX)/share/shotwell/icons504 mkdir -p $(DESTDIR)$(PREFIX)/share/shotwell/icons
506 $(INSTALL_DATA) icons/* $(DESTDIR)$(PREFIX)/share/shotwell/icons505 $(INSTALL_DATA) icons/* $(DESTDIR)$(PREFIX)/share/shotwell/icons
506 mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/actions/
507 $(INSTALL_DATA) icons/pin-toolbar.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/actions/
507 mkdir -p $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas508 mkdir -p $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
508 $(INSTALL_DATA) misc/org.yorba.shotwell.gschema.xml $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas509 $(INSTALL_DATA) misc/org.yorba.shotwell.gschema.xml $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
509 $(INSTALL_DATA) misc/org.yorba.shotwell-extras.gschema.xml $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas510 $(INSTALL_DATA) misc/org.yorba.shotwell-extras.gschema.xml $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
510511
=== modified file 'src/AppWindow.vala'
--- src/AppWindow.vala 2015-02-13 14:19:32 +0000
+++ src/AppWindow.vala 2015-08-09 22:03:19 +0000
@@ -10,7 +10,7 @@
10 public const int TOOLBAR_CHECK_DISMISSAL_MSEC = 500;10 public const int TOOLBAR_CHECK_DISMISSAL_MSEC = 500;
1111
12 private Gtk.Window toolbar_window = new Gtk.Window (Gtk.WindowType.POPUP);12 private Gtk.Window toolbar_window = new Gtk.Window (Gtk.WindowType.POPUP);
13 private Gtk.ToggleToolButton pin_button = new Gtk.ToggleToolButton.from_stock (Resources.PIN_TOOLBAR);13 private Gtk.ToggleToolButton pin_button = new Gtk.ToggleToolButton ();
14 private bool is_toolbar_shown = false;14 private bool is_toolbar_shown = false;
15 private bool waiting_for_invoke = false;15 private bool waiting_for_invoke = false;
16 private time_t left_toolbar_time = 0;16 private time_t left_toolbar_time = 0;
@@ -46,6 +46,7 @@
46 set_border_width (0);46 set_border_width (0);
4747
48 pin_button.set_label (_ ("Pin Toolbar"));48 pin_button.set_label (_ ("Pin Toolbar"));
49 pin_button.set_icon_widget (new Gtk.Image.from_icon_name ("pin-toolbar", Gtk.IconSize.LARGE_TOOLBAR));
49 pin_button.set_tooltip_text (_ ("Pin the toolbar open"));50 pin_button.set_tooltip_text (_ ("Pin the toolbar open"));
50 pin_button.clicked.connect (update_toolbar_dismissal);51 pin_button.clicked.connect (update_toolbar_dismissal);
5152
5253
=== modified file 'src/Resources.vala'
--- src/Resources.vala 2015-08-08 22:40:36 +0000
+++ src/Resources.vala 2015-08-09 22:03:19 +0000
@@ -79,7 +79,6 @@
79public const string STRAIGHTEN = "object-straighten";79public const string STRAIGHTEN = "object-straighten";
80public const string REDEYE = "image-red-eye";80public const string REDEYE = "image-red-eye";
81public const string ADJUST = "image-adjust";81public const string ADJUST = "image-adjust";
82public const string PIN_TOOLBAR = "shotwell-pin-toolbar";
83public const string IMPORT = "shotwell-import";82public const string IMPORT = "shotwell-import";
84public const string IMPORT_ALL = "shotwell-import-all";83public const string IMPORT_ALL = "shotwell-import-all";
85public const string ENHANCE = "image-auto-adjust";84public const string ENHANCE = "image-auto-adjust";
@@ -782,7 +781,6 @@
782public const string SELECT_ALL_MENU = _("Select _All");781public const string SELECT_ALL_MENU = _("Select _All");
783public const string SELECT_ALL_TOOLTIP = _("Select all items");782public const string SELECT_ALL_TOOLTIP = _("Select all items");
784783
785private Gtk.IconFactory factory = null;
786private Gee.HashMap<string, Gdk.Pixbuf> icon_cache = null;784private Gee.HashMap<string, Gdk.Pixbuf> icon_cache = null;
787Gee.HashMap<string, Gdk.Pixbuf> scaled_icon_cache = null;785Gee.HashMap<string, Gdk.Pixbuf> scaled_icon_cache = null;
788786
@@ -794,13 +792,6 @@
794private string START_MULTIMONTH_DATE_FORMAT_STRING = null;792private string START_MULTIMONTH_DATE_FORMAT_STRING = null;
795793
796public void init () {794public void init () {
797 // load application-wide stock icons as IconSets
798 factory = new Gtk.IconFactory ();
799
800 File icons_dir = AppDirs.get_resources_dir ().get_child ("icons");
801 add_stock_icon (icons_dir.get_child ("pin-toolbar.svg"), PIN_TOOLBAR);
802
803 factory.add_default ();
804795
805 generate_rating_strings ();796 generate_rating_strings ();
806797
@@ -1012,18 +1003,6 @@
1012 return (scale > 0) ? scale_pixbuf (pixbuf, scale, Gdk.InterpType.BILINEAR, false) : pixbuf;1003 return (scale > 0) ? scale_pixbuf (pixbuf, scale, Gdk.InterpType.BILINEAR, false) : pixbuf;
1013}1004}
10141005
1015private void add_stock_icon (File file, string stock_id) {
1016 Gdk.Pixbuf pixbuf = null;
1017 try {
1018 pixbuf = new Gdk.Pixbuf.from_file (file.get_path ());
1019 } catch (Error err) {
1020 critical ("Unable to load stock icon %s: %s", stock_id, err.message);
1021 }
1022
1023 Gtk.IconSet icon_set = new Gtk.IconSet.from_pixbuf (pixbuf);
1024 factory.add (stock_id, icon_set);
1025}
1026
1027public delegate void AddStockIconModify (Gdk.Pixbuf pixbuf);1006public delegate void AddStockIconModify (Gdk.Pixbuf pixbuf);
10281007
1029// Get the directory where our help files live. Returns a string1008// Get the directory where our help files live. Returns a string

Subscribers

People subscribed via source and target branches