X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fcontrol_point.cc;h=2a457c52f1ec487a19fcb06c375ccdb5d5644859;hb=cf52d6e4b40111eb04b244ec054055a4ec15dbe0;hp=7687beecaf8f680421921df44dcaadee9cfb745e;hpb=96eee9e7a162e3e26dd9c1ea4d8fc1ad02a3dda9;p=ardour.git diff --git a/gtk2_ardour/control_point.cc b/gtk2_ardour/control_point.cc index 7687beecaf..2a457c52f1 100644 --- a/gtk2_ardour/control_point.cc +++ b/gtk2_ardour/control_point.cc @@ -19,12 +19,12 @@ #include "control_point.h" #include "automation_line.h" -#include "ardour_ui.h" #include "public_editor.h" +#include "ui_config.h" #include "canvas/rectangle.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace std; using namespace ARDOUR; @@ -44,16 +44,13 @@ ControlPoint::ControlPoint (AutomationLine& al) _size = 4.0; _item = new ArdourCanvas::Rectangle (&_line.canvas_group()); - _item->property_draw() = true; - _item->set_fill (false); - _item->set_fill_color (ARDOUR_UI::config()->get_canvasvar_ControlPointFill()); - _item->set_outline_color (ARDOUR_UI::config()->get_canvasvar_ControlPointOutline()); - _item->set_outline_width (1); + _item->set_fill (true); + _item->set_fill_color (UIConfiguration::instance().color ("control point fill")); + _item->set_outline_color (UIConfiguration::instance().color ("control point outline")); _item->set_data ("control_point", this); _item->Event.connect (sigc::mem_fun (this, &ControlPoint::event_handler)); hide (); - set_visible (false); } ControlPoint::ControlPoint (const ControlPoint& other, bool /*dummy_arg_to_force_special_copy_constructor*/) @@ -72,20 +69,18 @@ ControlPoint::ControlPoint (const ControlPoint& other, bool /*dummy_arg_to_force _size = other._size; _item = new ArdourCanvas::Rectangle (&_line.canvas_group()); - _item->set_fill (false); - _item->set_outline_color (ARDOUR_UI::config()->get_canvasvar_ControlPointOutline()); - _item->set_outline_width (1); + _item->set_fill (true); + _item->set_outline_color (UIConfiguration::instance().color ("control point outline")); /* NOTE: no event handling in copied ControlPoints */ hide (); - set_visible (false); } ControlPoint::~ControlPoint () { CatchDeletion (this); /* EMIT SIGNAL */ - + delete _item; } @@ -107,16 +102,10 @@ ControlPoint::show() _item->show(); } -void -ControlPoint::set_visible (bool yn) -{ - _item->property_draw() = (gboolean) yn; -} - bool ControlPoint::visible () const { - return _item->property_draw (); + return _item->visible (); } void @@ -130,16 +119,13 @@ ControlPoint::reset (double x, double y, AutomationList::iterator mi, uint32_t v void ControlPoint::set_color () { - uint32_t color = 0; - if (_selected) { - color = ARDOUR_UI::config()->get_canvasvar_ControlPointSelected(); + _item->set_outline_color(UIConfiguration::instance().color ("control point selected outline"));; + _item->set_fill_color(UIConfiguration::instance().color ("control point selected fill")); } else { - color = ARDOUR_UI::config()->get_canvasvar_ControlPointOutline(); + _item->set_outline_color(UIConfiguration::instance().color ("control point outline")); + _item->set_fill_color(UIConfiguration::instance().color ("control point fill")); } - - _item->set_outline_color (color); - _item->set_fill_color (ARDOUR_UI::config()->get_canvasvar_ControlPointFill()); } void @@ -178,8 +164,8 @@ ControlPoint::move_to (double x, double y, ShapeType shape) _shape = shape; } -void -ControlPoint::i2w (double& x, double& y) const +ArdourCanvas::Item& +ControlPoint::item() const { - _item->item_to_canvas (x, y); + return *_item; }