#include "canvas/canvas.h"
#include "canvas/rectangle.h"
#include "canvas/debug.h"
+#include "canvas/utils.h"
+#include "canvas/colors.h"
#include "ardour/profile.h"
compute_heights ();
}
- _canvas_display = new ArdourCanvas::Container (ed.get_trackview_group (), ArdourCanvas::Duple (0.0, 0.0));
+ _canvas_display = new ArdourCanvas::Container (ed.get_trackview_group ());
CANVAS_DEBUG_NAME (_canvas_display, "main for TAV");
_canvas_display->hide(); // reveal as needed
- _canvas_separator = new ArdourCanvas::Line(ed.get_trackview_group ());
+ _canvas_separator = new ArdourCanvas::Line(_canvas_display);
CANVAS_DEBUG_NAME (_canvas_separator, "separator for TAV");
- _canvas_separator->set_outline_color(RGBA_TO_UINT (0, 0, 0, 255));
+ _canvas_separator->set (ArdourCanvas::Duple(0.0, 0.0), ArdourCanvas::Duple(ArdourCanvas::COORD_MAX, 0.0));
+ _canvas_separator->set_outline_color(ArdourCanvas::rgba_to_color (0, 0, 0, 1.0));
_canvas_separator->set_outline_width(1.0);
_canvas_separator->hide();
TimeAxisView::~TimeAxisView()
{
+ CatchDeletion (this);
+
in_destructor = true;
for (list<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
delete _canvas_display;
_canvas_display = 0;
- delete _canvas_separator;
- _canvas_separator = 0;
-
delete display_menu;
display_menu = 0;
_order = nth;
if (_y_position != y) {
- _canvas_separator->set (ArdourCanvas::Duple(0, y), ArdourCanvas::Duple(ArdourCanvas::COORD_MAX, y));
- _canvas_display->set_y_position (y + 1);
+ _canvas_display->set_y_position (y);
_y_position = y;
}
_canvas_display->raise_to_top ();
_canvas_display->show ();
-
- _canvas_separator->raise_to_top ();
- _canvas_separator->show ();
-
+
_hidden = false;
_effective_height = current_height ();
}
}
+ /* put separator at the bottom of this time axis view */
+
+ _canvas_separator->set (ArdourCanvas::Duple(0, height), ArdourCanvas::Duple(ArdourCanvas::COORD_MAX, height));
+ _canvas_separator->lower_to_bottom ();
+ _canvas_separator->show ();
+
return _effective_height;
}
}
void
-TimeAxisView::idle_resize (uint32_t h)
+TimeAxisView::idle_resize (int32_t h)
{
- set_height (h);
+ set_height (std::max(0, h));
}
rect = new SelectionRect;
- rect->rect = new ArdourCanvas::Rectangle (selection_group);
+ rect->rect = new ArdourCanvas::TimeRectangle (selection_group);
CANVAS_DEBUG_NAME (rect->rect, "selection rect");
rect->rect->set_outline (false);
- rect->rect->set_fill_color (ARDOUR_UI::config()->get_SelectionRect());
+ rect->rect->set_fill_color (ARDOUR_UI::config()->color_mod ("selection rect", "selection rect"));
rect->start_trim = new ArdourCanvas::Rectangle (selection_group);
CANVAS_DEBUG_NAME (rect->start_trim, "selection rect start trim");
for (list<SelectionRect*>::iterator i = used_selection_rects.begin(); i != used_selection_rects.end(); ++i) {
- (*i)->rect->set_fill_color (ARDOUR_UI::config()->get_SelectionRect());
- (*i)->rect->set_outline_color (ARDOUR_UI::config()->get_Selection());
+ (*i)->rect->set_fill_color (ARDOUR_UI::config()->color_mod ("selection rect", "selection rect"));
+ (*i)->rect->set_outline_color (ARDOUR_UI::config()->color ("selection"));
- (*i)->start_trim->set_fill_color (ARDOUR_UI::config()->get_Selection());
- (*i)->start_trim->set_outline_color (ARDOUR_UI::config()->get_Selection());
+ (*i)->start_trim->set_fill_color (ARDOUR_UI::config()->color ("selection"));
+ (*i)->start_trim->set_outline_color (ARDOUR_UI::config()->color ("selection"));
- (*i)->end_trim->set_fill_color (ARDOUR_UI::config()->get_Selection());
- (*i)->end_trim->set_outline_color (ARDOUR_UI::config()->get_Selection());
+ (*i)->end_trim->set_fill_color (ARDOUR_UI::config()->color ("selection"));
+ (*i)->end_trim->set_outline_color (ARDOUR_UI::config()->color ("selection"));
}
for (list<SelectionRect*>::iterator i = free_selection_rects.begin(); i != free_selection_rects.end(); ++i) {
- (*i)->rect->set_fill_color (ARDOUR_UI::config()->get_SelectionRect());
- (*i)->rect->set_outline_color (ARDOUR_UI::config()->get_Selection());
+ (*i)->rect->set_fill_color (ARDOUR_UI::config()->color_mod ("selection rect", "selection rect"));
+ (*i)->rect->set_outline_color (ARDOUR_UI::config()->color ("selection"));
- (*i)->start_trim->set_fill_color (ARDOUR_UI::config()->get_Selection());
- (*i)->start_trim->set_outline_color (ARDOUR_UI::config()->get_Selection());
+ (*i)->start_trim->set_fill_color (ARDOUR_UI::config()->color ("selection"));
+ (*i)->start_trim->set_outline_color (ARDOUR_UI::config()->color ("selection"));
- (*i)->end_trim->set_fill_color (ARDOUR_UI::config()->get_Selection());
- (*i)->end_trim->set_outline_color (ARDOUR_UI::config()->get_Selection());
+ (*i)->end_trim->set_fill_color (ARDOUR_UI::config()->color ("selection"));
+ (*i)->end_trim->set_outline_color (ARDOUR_UI::config()->color ("selection"));
}
}
return button_height + extra_height;
}
- /* NOTREACHED */
+ abort(); /* NOTREACHED */
return 0;
}