diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-02 15:54:51 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-02 15:54:51 +0000 |
commit | f9a47cff2b7f07b769fe674f395e413fc40501fe (patch) | |
tree | 303233544e36627ecf6dd3de7e5a53f6418e1416 /gtk2_ardour/marker.cc | |
parent | 519eaabe8b7995b986b05c050b814cd09cbd4859 (diff) |
make marker labels and regionview name text (now drawn with pixbufs) be color-adjustable just like all other canvas items2.8.9
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@7212 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/marker.cc')
-rw-r--r-- | gtk2_ardour/marker.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gtk2_ardour/marker.cc b/gtk2_ardour/marker.cc index 22fc535722..ab895394ec 100644 --- a/gtk2_ardour/marker.cc +++ b/gtk2_ardour/marker.cc @@ -255,9 +255,10 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con name_pixbuf->property_x() = label_offset; name_pixbuf->property_y() = (13 / 2) - (name_height / 2); - set_name (annotation.c_str()); + set_name (annotation); editor.ZoomChanged.connect (mem_fun (*this, &Marker::reposition)); + ColorsChanged.connect (mem_fun (*this, &Marker::color_handler)); mark->set_data ("marker", this); @@ -343,11 +344,20 @@ Marker::the_item() const } void +Marker::color_handler () +{ + set_name (_annotation); +} + +void Marker::set_name (const string& new_name) { int name_width = pixel_width (new_name, *name_font) + 2; - name_pixbuf->property_pixbuf() = pixbuf_from_ustring(new_name, name_font, name_width, name_height); + _annotation = new_name; + name_pixbuf->property_pixbuf() = pixbuf_from_ustring(new_name, name_font, + ARDOUR_UI::config()->canvasvar_MarkerLabel.get(), + name_width, name_height); if (_type == End || _type == LoopEnd || _type == PunchOut) { name_pixbuf->property_x() = - (name_width); |