[solang] The "slideshow-play" icons are now themeable



commit 606e32ead7a9c907d30ac52b6ff97de9a6dd208a
Author: Debarshi Ray <rishi gnu org>
Date:   Sun Mar 21 00:58:21 2010 +0200

    The "slideshow-play" icons are now themeable
    
    http://live.gnome.org/ThemableAppSpecificIcons

 README                                             |   12 +++---
 data/Makefile.am                                   |    6 ---
 data/icons/16x16/Makefile.am                       |    4 ++
 .../16x16/actions/slideshow-play.png}              |  Bin 663 -> 663 bytes
 data/icons/22x22/Makefile.am                       |    4 ++
 .../22x22/actions/slideshow-play.png}              |  Bin 979 -> 979 bytes
 data/icons/24x24/Makefile.am                       |    4 ++
 .../24x24/actions/slideshow-play.png}              |  Bin 983 -> 983 bytes
 data/icons/32x32/Makefile.am                       |    4 ++
 .../32x32/actions/slideshow-play.png}              |  Bin 1337 -> 1337 bytes
 data/icons/48x48/Makefile.am                       |    4 ++
 .../48x48/actions/slideshow-play.png}              |  Bin 1717 -> 1717 bytes
 data/icons/scalable/Makefile.am                    |    4 ++
 .../scalable/actions}/slideshow-play.svg           |    0
 src/application/application.cpp                    |   45 +-------------------
 src/application/application.h                      |    3 -
 src/application/main.cpp                           |    3 +
 src/renderer/browser-renderer.cpp                  |    4 +-
 src/renderer/enlarged-renderer.cpp                 |    4 +-
 19 files changed, 38 insertions(+), 63 deletions(-)
---
diff --git a/README b/README
index 62b04bb..105befe 100644
--- a/README
+++ b/README
@@ -79,12 +79,12 @@ The following pieces of artwork were borrowed from Eye of GNOME
 <nisses mail home se> and Michael Montreal <michael monreal gmx net>, and
 originally licensed under the GNU General Public License version 2 or later.
 
-+ data/slideshow-play-16.png
-+ data/slideshow-play-22.png
-+ data/slideshow-play-24.png
-+ data/slideshow-play-32.png
-+ data/slideshow-play-48.png
-+ data/slideshow-play.svg
++ data/icons/scalable/actions/slideshow-play.svg
++ data/icons/16x16/actions/slideshow-play.png
++ data/icons/32x32/actions/slideshow-play.png
++ data/icons/24x24/actions/slideshow-play.png
++ data/icons/22x22/actions/slideshow-play.png
++ data/icons/48x48/actions/slideshow-play.png
 
 The following pieces of artwork were borrowed from F-Spot (http://f-spot.org/).
 These are copyrighted by Jakub Steiner <jimmac ximian com> and Novell, and
diff --git a/data/Makefile.am b/data/Makefile.am
index f5ddaf9..6c3b6ce 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -25,12 +25,6 @@ pixmap_DATA = \
 	mode-image-edit-16.png \
 	mode-image-edit-22.png \
 	mode-image-edit-24.png \
-	slideshow-play-16.png \
-	slideshow-play-22.png \
-	slideshow-play-24.png \
-	slideshow-play-32.png \
-	slideshow-play-48.png \
-	slideshow-play.svg \
 	tag-16.png \
 	tag-22.png \
 	tag-new-16.png \
diff --git a/data/icons/16x16/Makefile.am b/data/icons/16x16/Makefile.am
index b1c6ace..af86bf0 100644
--- a/data/icons/16x16/Makefile.am
+++ b/data/icons/16x16/Makefile.am
@@ -1,5 +1,9 @@
 size = 16x16
 
+actioniconsdir = $(pkgdatadir)/icons/hicolor/$(size)/actions
+dist_actionicons_DATA = \
+	actions/slideshow-play.png
+
 appiconsdir = $(datadir)/icons/hicolor/$(size)/apps
 dist_appicons_DATA = \
 	apps/solang.png
diff --git a/data/slideshow-play-16.png b/data/icons/16x16/actions/slideshow-play.png
similarity index 100%
rename from data/slideshow-play-16.png
rename to data/icons/16x16/actions/slideshow-play.png
diff --git a/data/icons/22x22/Makefile.am b/data/icons/22x22/Makefile.am
index cab822c..f65071a 100644
--- a/data/icons/22x22/Makefile.am
+++ b/data/icons/22x22/Makefile.am
@@ -1,5 +1,9 @@
 size = 22x22
 
+actioniconsdir = $(pkgdatadir)/icons/hicolor/$(size)/actions
+dist_actionicons_DATA = \
+	actions/slideshow-play.png
+
 appiconsdir = $(datadir)/icons/hicolor/$(size)/apps
 dist_appicons_DATA = \
 	apps/solang.png
diff --git a/data/slideshow-play-22.png b/data/icons/22x22/actions/slideshow-play.png
similarity index 100%
rename from data/slideshow-play-22.png
rename to data/icons/22x22/actions/slideshow-play.png
diff --git a/data/icons/24x24/Makefile.am b/data/icons/24x24/Makefile.am
index 1ce4880..80b68aa 100644
--- a/data/icons/24x24/Makefile.am
+++ b/data/icons/24x24/Makefile.am
@@ -1,5 +1,9 @@
 size = 24x24
 
+actioniconsdir = $(pkgdatadir)/icons/hicolor/$(size)/actions
+dist_actionicons_DATA = \
+	actions/slideshow-play.png
+
 appiconsdir = $(datadir)/icons/hicolor/$(size)/apps
 dist_appicons_DATA = \
 	apps/solang.png
diff --git a/data/slideshow-play-24.png b/data/icons/24x24/actions/slideshow-play.png
similarity index 100%
rename from data/slideshow-play-24.png
rename to data/icons/24x24/actions/slideshow-play.png
diff --git a/data/icons/32x32/Makefile.am b/data/icons/32x32/Makefile.am
index 51edd5a..67c0dea 100644
--- a/data/icons/32x32/Makefile.am
+++ b/data/icons/32x32/Makefile.am
@@ -1,5 +1,9 @@
 size = 32x32
 
+actioniconsdir = $(pkgdatadir)/icons/hicolor/$(size)/actions
+dist_actionicons_DATA = \
+	actions/slideshow-play.png
+
 appiconsdir = $(datadir)/icons/hicolor/$(size)/apps
 dist_appicons_DATA = \
 	apps/solang.png
diff --git a/data/slideshow-play-32.png b/data/icons/32x32/actions/slideshow-play.png
similarity index 100%
rename from data/slideshow-play-32.png
rename to data/icons/32x32/actions/slideshow-play.png
diff --git a/data/icons/48x48/Makefile.am b/data/icons/48x48/Makefile.am
index 5749c09..c38edba 100644
--- a/data/icons/48x48/Makefile.am
+++ b/data/icons/48x48/Makefile.am
@@ -1,5 +1,9 @@
 size = 48x48
 
+actioniconsdir = $(pkgdatadir)/icons/hicolor/$(size)/actions
+dist_actionicons_DATA = \
+	actions/slideshow-play.png
+
 appiconsdir = $(datadir)/icons/hicolor/$(size)/apps
 dist_appicons_DATA = \
 	apps/solang.png
diff --git a/data/slideshow-play-48.png b/data/icons/48x48/actions/slideshow-play.png
similarity index 100%
rename from data/slideshow-play-48.png
rename to data/icons/48x48/actions/slideshow-play.png
diff --git a/data/icons/scalable/Makefile.am b/data/icons/scalable/Makefile.am
index 5497e69..d3130c3 100644
--- a/data/icons/scalable/Makefile.am
+++ b/data/icons/scalable/Makefile.am
@@ -1,5 +1,9 @@
 size = scalable
 
+actioniconsdir = $(pkgdatadir)/icons/hicolor/$(size)/actions
+dist_actionicons_DATA = \
+	actions/slideshow-play.svg
+
 appiconsdir = $(datadir)/icons/hicolor/$(size)/apps
 dist_appicons_DATA = \
 	apps/solang.svg
diff --git a/data/slideshow-play.svg b/data/icons/scalable/actions/slideshow-play.svg
similarity index 100%
rename from data/slideshow-play.svg
rename to data/icons/scalable/actions/slideshow-play.svg
diff --git a/src/application/application.cpp b/src/application/application.cpp
index b2eb372..0c9a48b 100644
--- a/src/application/application.cpp
+++ b/src/application/application.cpp
@@ -243,7 +243,7 @@ Application::Application(int & argc, char ** & argv) throw() :
         }
     }
 
-    add_icons();
+    Gtk::Window::set_default_icon_name(PACKAGE_TARNAME);
 
     engine_.signal_criteria_changed().connect(
         sigc::mem_fun(*this,
@@ -364,49 +364,6 @@ Application::final() throw()
 }
 
 void
-Application::add_icons() throw()
-{
-    Gtk::IconSource icon_source;
-    Gtk::IconSet icon_set_slideshow_play;
-
-    icon_source.set_filename(PACKAGE_DATA_DIR G_DIR_SEPARATOR_S
-                             "pixmaps" G_DIR_SEPARATOR_S
-                             "slideshow-play-16.png");
-    icon_source.set_size(Gtk::IconSize(16));
-    icon_set_slideshow_play.add_source(icon_source);
-
-    icon_source.set_filename(PACKAGE_DATA_DIR G_DIR_SEPARATOR_S
-                             "pixmaps" G_DIR_SEPARATOR_S
-                             "slideshow-play-22.png");
-    icon_source.set_size(Gtk::IconSize(22));
-    icon_set_slideshow_play.add_source(icon_source);
-
-    icon_source.set_filename(PACKAGE_DATA_DIR G_DIR_SEPARATOR_S
-                             "pixmaps" G_DIR_SEPARATOR_S
-                             "slideshow-play-24.png");
-    icon_source.set_size(Gtk::IconSize(24));
-    icon_set_slideshow_play.add_source(icon_source);
-
-    icon_source.set_filename(PACKAGE_DATA_DIR G_DIR_SEPARATOR_S
-                             "pixmaps" G_DIR_SEPARATOR_S
-                             "slideshow-play-32.png");
-    icon_source.set_size(Gtk::IconSize(32));
-    icon_set_slideshow_play.add_source(icon_source);
-
-    icon_source.set_filename(PACKAGE_DATA_DIR G_DIR_SEPARATOR_S
-                             "pixmaps" G_DIR_SEPARATOR_S
-                             "slideshow-play-48.png");
-    icon_source.set_size(Gtk::IconSize(48));
-    icon_set_slideshow_play.add_source(icon_source);
-
-    iconFactory_->add(Gtk::StockID(PACKAGE_TARNAME"-slideshow-play"),
-                      icon_set_slideshow_play);
-    iconFactory_->add_default();
-
-    Gtk::Window::set_default_icon_name(PACKAGE_TARNAME);
-}
-
-void
 Application::add_photo_to_model(const PhotoPtr & photo) throw()
 {
     Gtk::TreeModel::iterator model_iter = listStore_->append();
diff --git a/src/application/application.h b/src/application/application.h
index dcd60be..57ce530 100644
--- a/src/application/application.h
+++ b/src/application/application.h
@@ -101,9 +101,6 @@ class Application :
 
     private:
         void
-        add_icons() throw();
-
-        void
         add_photo_to_model(const PhotoPtr & photo) throw();
 
         void
diff --git a/src/application/main.cpp b/src/application/main.cpp
index 111f0f0..ec76a45 100644
--- a/src/application/main.cpp
+++ b/src/application/main.cpp
@@ -51,8 +51,11 @@ main(int argc, char *argv[])
     Gtk::Main kit(argc, argv, true);
 
     const Solang::IconThemePtr icon_theme = Gtk::IconTheme::get_default();
+
     icon_theme->append_search_path(DATA_DIR G_DIR_SEPARATOR_S
                                    "icons");
+    icon_theme->append_search_path(PACKAGE_DATA_DIR G_DIR_SEPARATOR_S
+                                   "icons");
 
     Solang::Application application(argc, argv);
 
diff --git a/src/renderer/browser-renderer.cpp b/src/renderer/browser-renderer.cpp
index ad2b3a3..4888c42 100644
--- a/src/renderer/browser-renderer.cpp
+++ b/src/renderer/browser-renderer.cpp
@@ -138,9 +138,9 @@ BrowserRenderer::BrowserRenderer() throw() :
                       &BrowserRenderer::on_action_add_to_export_queue));
 
     actionGroup_->add(
-        Gtk::Action::create(
+        Gtk::Action::create_with_icon_name(
             "ActionViewBrowserSlideshow",
-            Gtk::StockID(PACKAGE_TARNAME"-slideshow-play"),
+            "slideshow-play",
             _("_Slideshow"),
             _("Start a slideshow view of the photos")),
         Gtk::AccelKey("F5"),
diff --git a/src/renderer/enlarged-renderer.cpp b/src/renderer/enlarged-renderer.cpp
index d14b85d..a7bc120 100644
--- a/src/renderer/enlarged-renderer.cpp
+++ b/src/renderer/enlarged-renderer.cpp
@@ -298,9 +298,9 @@ EnlargedRenderer::create_action_group() throw()
                                               __LINE__));
 
     actionGroup_->add(
-        Gtk::Action::create(
+        Gtk::Action::create_with_icon_name(
             "ActionViewEnlargedSlideshow",
-            Gtk::StockID(PACKAGE_TARNAME"-slideshow-play"),
+            "slideshow-play",
             _("_Slideshow"),
             _("Start a slideshow view of the photos")),
         Gtk::AccelKey("F5"),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]