#include "gtkmm2ext/utils.h"
#include "gtkmm2ext/gui_thread.h"
-#include "canvas/group.h"
+#include "canvas/container.h"
#include "canvas/rectangle.h"
#include "canvas/debug.h"
#include "canvas/text.h"
using namespace Glib;
using namespace PBD;
using namespace ARDOUR;
+using namespace ARDOUR_UI_UTILS;
using namespace Gtkmm2ext;
Pango::FontDescription TimeAxisViewItem::NAME_FONT;
* @param automation true if this is an automation region view
*/
TimeAxisViewItem::TimeAxisViewItem(
- const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, uint32_t base_color,
+ const string & it_name, ArdourCanvas::Item& parent, TimeAxisView& tv, double spu, uint32_t base_color,
framepos_t start, framecnt_t duration, bool recording, bool automation, Visibility vis
)
: trackview (tv)
{
/* share the other's parent, but still create a new group */
- ArdourCanvas::Group* parent = other.group->parent();
+ ArdourCanvas::Item* parent = other.group->parent();
_selected = other._selected;
}
void
-TimeAxisViewItem::init (ArdourCanvas::Group* parent, double fpp, uint32_t base_color,
+TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_color,
framepos_t start, framepos_t duration, Visibility vis,
bool wide, bool high)
{
- group = new ArdourCanvas::Group (parent);
+ group = new ArdourCanvas::Container (parent);
CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
trackview.current_height() - 1.0));
CANVAS_DEBUG_NAME (frame, string_compose ("frame for %1", get_item_name()));
-
+
if (Config->get_show_name_highlight()) {
frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
} else {
name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, NAME_Y_OFFSET));
}
name_text->set_font_description (NAME_FONT);
+ name_text->set_ignore_events (true);
} else {
name_text = 0;
}
if (_selected != yn) {
Selectable::set_selected (yn);
set_frame_color ();
+ set_name_text_color ();
+
+ if (frame) {
+ if (!Config->get_show_name_highlight() && yn) {
+ frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT|ArdourCanvas::Rectangle::BOTTOM|ArdourCanvas::Rectangle::TOP));
+ frame->set_y1 (_height - 1.0);
+ } else {
+ if (Config->get_show_name_highlight()) {
+ frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
+ } else {
+ frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT|ArdourCanvas::Rectangle::BOTTOM));
+ }
+ frame->set_y1 (_height);
+ }
+ }
}
}
}
if (frame) {
- frame->set_y1 (height);
+ if (!Config->get_show_name_highlight() && _selected) {
+ frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT|ArdourCanvas::Rectangle::BOTTOM|ArdourCanvas::Rectangle::TOP));
+ frame->set_y1 (_height - 1.0);
+ } else {
+ if (Config->get_show_name_highlight()) {
+ frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
+ } else {
+ frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT|ArdourCanvas::Rectangle::BOTTOM));
+ }
+ frame->set_y1 (_height);
+ }
+
if (frame_handle_start) {
frame_handle_start->set_y1 (height);
frame_handle_end->set_y1 (height);
return frame;
}
-ArdourCanvas::Group*
+ArdourCanvas::Item*
TimeAxisViewItem::get_canvas_group()
{
return group;
f = get_fill_color ();
}
- name_text->set_color (contrasting_text_color (f));
+ name_text->set_color (ArdourCanvas::contrasting_text_color (f));
}
uint32_t