diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-10-29 15:53:22 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-10-29 15:53:22 +0000 |
commit | d7b685cc5fa0b87e2c5569d97772605759daa586 (patch) | |
tree | 89e9bf11c199e8026898fefaddaae19fd6bc0f77 /libs/gtkmm2ext | |
parent | f871d665d59e3b95f9d47a80e5caead15d9a705b (diff) |
make it possible (hackily) to pick the base color for the knob images created by MotionFeedback
git-svn-id: svn://localhost/ardour2/branches/3.0@10337 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/gtkmm2ext')
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/motionfeedback.h | 3 | ||||
-rw-r--r-- | libs/gtkmm2ext/motionfeedback.cc | 19 |
2 files changed, 19 insertions, 3 deletions
diff --git a/libs/gtkmm2ext/gtkmm2ext/motionfeedback.h b/libs/gtkmm2ext/gtkmm2ext/motionfeedback.h index 70ab50d6ba..b4bf2d9c02 100644 --- a/libs/gtkmm2ext/gtkmm2ext/motionfeedback.h +++ b/libs/gtkmm2ext/gtkmm2ext/motionfeedback.h @@ -63,7 +63,7 @@ class MotionFeedback : public Gtk::VBox boost::shared_ptr<PBD::Controllable> controllable() const; virtual void set_controllable (boost::shared_ptr<PBD::Controllable> c); - void set_lamp_color (const Gdk::Color&); + static void set_lamp_color (const std::string&); static Glib::RefPtr<Gdk::Pixbuf> render_pixbuf (int size); @@ -111,6 +111,7 @@ class MotionFeedback : public Gtk::VBox Gtk::EventBox* value_packer; Glib::RefPtr<Gdk::Pixbuf> pixbuf; BindingProxy binding_proxy; + static Gdk::Color* base_color; void (*print_func) (char buf[32], const boost::shared_ptr<PBD::Controllable>&, void *); void *print_arg; diff --git a/libs/gtkmm2ext/motionfeedback.cc b/libs/gtkmm2ext/motionfeedback.cc index 6b85913d0c..7a6d02f531 100644 --- a/libs/gtkmm2ext/motionfeedback.cc +++ b/libs/gtkmm2ext/motionfeedback.cc @@ -39,6 +39,8 @@ using namespace Gtk; using namespace Gtkmm2ext; using namespace sigc; +Gdk::Color* MotionFeedback::base_color; + MotionFeedback::MotionFeedback (Glib::RefPtr<Gdk::Pixbuf> pix, Type t, boost::shared_ptr<PBD::Controllable> c, @@ -60,6 +62,10 @@ MotionFeedback::MotionFeedback (Glib::RefPtr<Gdk::Pixbuf> pix, , subwidth (subw) , subheight (subh) { + if (!base_color) { + base_color = new Gdk::Color ("#1a5274"); + } + char value_name[1024]; print_func = default_printer; @@ -467,12 +473,11 @@ MotionFeedback::render_pixbuf (int size) GdkColor col2 = {0,0,0,0}; GdkColor col3 = {0,0,0,0}; - Gdk::Color base ("#b9feff"); GdkColor dark; GdkColor bright; ProlooksHSV* hsv; - hsv = prolooks_hsv_new_for_gdk_color (base.gobj()); + hsv = prolooks_hsv_new_for_gdk_color (base_color->gobj()); bright = (prolooks_hsv_to_gdk_color (hsv, &col2), col2); prolooks_hsv_set_saturation (hsv, 0.66); prolooks_hsv_set_value (hsv, 0.67); @@ -729,3 +734,13 @@ MotionFeedback::core_draw (cairo_t* cr, int phase, double size, double progress_ cairo_pattern_destroy (knob_ripples); } + +void +MotionFeedback::set_lamp_color (const std::string& str) +{ + if (base_color) { + *base_color = Gdk::Color (str); + } else { + base_color = new Gdk::Color (str); + } +} |