X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftime_axis_view_item.cc;h=8de294deb2fc1995afd8a0268f18f50cfb545c54;hb=64e69c36da8226a89902c4660c80f9470e7b55db;hp=e02117385aaa33737720c45c6864b50a7c7b0a62;hpb=d5391a986358479d94b99f7d9e4f3950a6dd4dd8;p=ardour.git diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index e02117385a..8de294deb2 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -161,10 +161,11 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo frame = new ArdourCanvas::SimpleRect (*group); frame->property_x1() = (double) 0.0; frame->property_y1() = (double) 1.0; - frame->property_x2() = (double) trackview.editor.frame_to_pixel(duration); + frame->property_x2() = (double) trackview.editor().frame_to_pixel(duration); frame->property_y2() = (double) trackview.current_height(); frame->property_outline_pixels() = 1; frame->property_outline_what() = 0xF; + frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get(); /* by default draw all 4 edges */ @@ -192,10 +193,10 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo name_highlight = new ArdourCanvas::SimpleRect (*group); if (visibility & FullWidthNameHighlight) { name_highlight->property_x1() = (double) 0.0; - name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration)); + name_highlight->property_x2() = (double) (trackview.editor().frame_to_pixel(item_duration)); } else { name_highlight->property_x1() = (double) 1.0; - name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration)) - 1; + name_highlight->property_x2() = (double) (trackview.editor().frame_to_pixel(item_duration)) - 1; } name_highlight->property_y1() = (double) (trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE); name_highlight->property_y2() = (double) (trackview.current_height() - 1); @@ -230,12 +231,14 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo frame_handle_start->property_x2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH; frame_handle_start->property_y1() = (double) 1.0; frame_handle_start->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH+1; + frame_handle_start->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle.get(); frame_handle_end = new ArdourCanvas::SimpleRect (*group); - frame_handle_end->property_x1() = (double) (trackview.editor.frame_to_pixel(get_duration())) - (TimeAxisViewItem::GRAB_HANDLE_LENGTH); - frame_handle_end->property_x2() = (double) trackview.editor.frame_to_pixel(get_duration()); + frame_handle_end->property_x1() = (double) (trackview.editor().frame_to_pixel(get_duration())) - (TimeAxisViewItem::GRAB_HANDLE_LENGTH); + frame_handle_end->property_x2() = (double) trackview.editor().frame_to_pixel(get_duration()); frame_handle_end->property_y1() = (double) 1; frame_handle_end->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH + 1; + frame_handle_end->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle.get(); } else { frame_handle_start = 0; @@ -336,7 +339,7 @@ TimeAxisViewItem::set_duration (nframes_t dur, void* src) item_duration = dur; - reset_width_dependent_items (trackview.editor.frame_to_pixel (dur)); + reset_width_dependent_items (trackview.editor().frame_to_pixel (dur)); DurationChanged (dur, src) ; /* EMIT_SIGNAL */ return true; @@ -1045,3 +1048,14 @@ TimeAxisViewItem::idle_remove_this_item(TimeAxisViewItem* item, void* src) return false; } +void +TimeAxisViewItem::set_y (double y) +{ + double const old = group->property_y (); + if (y != old) { + group->move (0, y - old); + } +} + + +