[niepce] fwk: EditableHScale take a resource path for the icon



commit afabe998d0fea5512f93b0ae935f9b6b7d9deab9
Author: Hubert Figuière <hub figuiere net>
Date:   Fri Dec 27 17:40:01 2019 -0500

    fwk: EditableHScale take a resource path for the icon

 src/fwk/toolkit/widgets/editablehscale.cpp        | 4 ++--
 src/niepce/modules/darkroom/toolboxcontroller.cpp | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/fwk/toolkit/widgets/editablehscale.cpp b/src/fwk/toolkit/widgets/editablehscale.cpp
index 5660eb0..9d47ffc 100644
--- a/src/fwk/toolkit/widgets/editablehscale.cpp
+++ b/src/fwk/toolkit/widgets/editablehscale.cpp
@@ -39,10 +39,10 @@ EditableHScale::EditableHScale(double min, double max, double step)
 }
 
 
-EditableHScale::EditableHScale(const std::string & icon_path, 
+EditableHScale::EditableHScale(const std::string & icon_path,
                                double min, double max, double step)
     : Gtk::Box(Gtk::ORIENTATION_HORIZONTAL),
-      m_icon(Gtk::manage(new Gtk::Image(icon_path))),
+      m_icon(Gtk::manage(new Gtk::Image(Gdk::Pixbuf::create_from_resource(icon_path, -1, -1)))),
       m_adj(Gtk::Adjustment::create(0, min, max, step)),
       m_scale(m_adj), m_entry(m_adj),
       m_dirty(false)
diff --git a/src/niepce/modules/darkroom/toolboxcontroller.cpp 
b/src/niepce/modules/darkroom/toolboxcontroller.cpp
index 773981a..4e0df36 100644
--- a/src/niepce/modules/darkroom/toolboxcontroller.cpp
+++ b/src/niepce/modules/darkroom/toolboxcontroller.cpp
@@ -55,7 +55,7 @@ ToolboxController::buildWidget()
 
     item = manage(new DrItemWidget(_("Crop")));
     toolbox->pack_start(*item, Gtk::PACK_SHRINK);
-    s = Gtk::manage(new fwk::EditableHScale(DATADIR"/niepce/pixmaps/niepce-transform-rotate.png",
+    s = Gtk::manage(new fwk::EditableHScale("/org/gnome/Niepce/pixmaps/niepce-transform-rotate.png",
                                             -45.0, 45.0, 0.5));
     item->add_widget(_("Tilt"), *s);
 


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