_stripable->set_active_color_picker (0);
}
_stripable.reset ();
+ _color_changed_connection.disconnect ();
}
void
_stripable = s;
_stripable->set_active_color_picker (this);
+ _initial_color = _stripable->presentation_info().color ();
set_title (string_compose (_("Color Selection: %1"), s->name()));
get_colorsel()->set_has_opacity_control (false);
get_colorsel()->set_has_palette (true);
- Gdk::Color c = gdk_color_from_rgba (_stripable->presentation_info().color ());
+ Gdk::Color c = gdk_color_from_rgba (_initial_color);
get_colorsel()->set_previous_color (c);
get_colorsel()->set_current_color (c);
+ _color_changed_connection = get_colorsel()->signal_color_changed().connect (sigc::mem_fun (*this, &StripableColorDialog::color_changed));
present ();
}
{
if (_stripable && response == RESPONSE_OK) {
_stripable->presentation_info().set_color (gdk_color_to_rgba (get_colorsel()->get_current_color()));
+ } else {
+ _stripable->presentation_info().set_color (_initial_color);
}
reset ();
}
+
+void
+StripableColorDialog::color_changed ()
+{
+ if (_stripable) {
+ _stripable->presentation_info().set_color (gdk_color_to_rgba (get_colorsel()->get_current_color()));
+ }
+}
private:
void initialize_color_palette ();
void finish_color_edit (int response);
+ void color_changed ();
boost::shared_ptr<ARDOUR::Stripable> _stripable;
+ ARDOUR::PresentationInfo::color_t _initial_color;
+
+ sigc::connection _color_changed_connection;
static bool palette_initialized;