#include "canvas/rectangle.h"
#include "canvas/debug.h"
#include "canvas/text.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
#include "ardour/profile.h"
#include "utils.h"
#include "rgb_macros.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace Editing;
void
TimeAxisViewItem::set_constant_heights ()
{
- NAME_FONT = Pango::FontDescription (UIConfiguration::instance().get_SmallFont());
+ NAME_FONT = Pango::FontDescription (UIConfiguration::instance().get_SmallFont());
- Gtk::Window win;
- Gtk::Label foo;
- win.add (foo);
+ Gtk::Window win;
+ Gtk::Label foo;
+ win.add (foo);
- Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout (X_("Hg")); /* ascender + descender */
- int width = 0;
- int height = 0;
+ Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout (X_("Hg")); /* ascender + descender */
+ int width = 0;
+ int height = 0;
- layout->set_font_description (NAME_FONT);
- get_pixel_size (layout, width, height);
+ layout->set_font_description (NAME_FONT);
+ get_pixel_size (layout, width, height);
- layout = foo.create_pango_layout (X_("H")); /* just the ascender */
+ layout = foo.create_pango_layout (X_("H")); /* just the ascender */
- NAME_HEIGHT = height;
+ NAME_HEIGHT = height;
/* Config->get_show_name_highlight) == true:
Y_OFFSET is measured from bottom of the time axis view item.
NAME_Y_OFFSET = 3;
NAME_HIGHLIGHT_SIZE = 0;
}
- NAME_HIGHLIGHT_THRESH = NAME_HIGHLIGHT_SIZE * 3;
+ NAME_HIGHLIGHT_THRESH = NAME_HIGHLIGHT_SIZE * 3;
}
/**
name_highlight = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name()));
name_highlight->set_data ("timeaxisviewitem", this);
- name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
- name_highlight->set_outline_color (RGBA_TO_UINT (0,0,0,255)); // this should use a theme color
+ name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
+ name_highlight->set_outline_color (RGBA_TO_UINT (0,0,0,255)); // this should use a theme color
} else {
name_highlight = 0;
group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
//Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&TimeAxisViewItem::parameter_changed, this, _1), gui_context ());
- //UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &TimeAxisViewItem::parameter_changed));
+ UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &TimeAxisViewItem::parameter_changed));
}
TimeAxisViewItem::~TimeAxisViewItem()
void
TimeAxisViewItem::set_height (double height)
{
- _height = height;
+ _height = height;
manage_name_highlight ();
set_frame_color ();
if (name_highlight) {
- name_highlight->set_fill_color (fill_color);
+ name_highlight->set_fill_color (fill_color);
}
set_name_text_color ();
f = get_fill_color ();
}
- name_text->set_color (ArdourCanvas::contrasting_text_color (f));
+ name_text->set_color (contrasting_text_color (f));
}
-ArdourCanvas::Color
+Gtkmm2ext::Color
TimeAxisViewItem::get_fill_color () const
{
const std::string mod_name = (_dragging ? "dragging region" : fill_color_name);
ArdourCanvas::Fill::StopList stops;
double r, g, b, a;
double h, s, v;
- ArdourCanvas::Color f (get_fill_color());
+ Color f (get_fill_color());
/* need to get alpha value */
- ArdourCanvas::color_to_rgba (f, r, g, b, a);
+ color_to_rgba (f, r, g, b, a);
stops.push_back (std::make_pair (0.0, f));
/* now a darker version */
- ArdourCanvas::color_to_hsv (f, h, s, v);
+ color_to_hsv (f, h, s, v);
v = min (1.0, v * (1.0 - UIConfiguration::instance().get_timeline_item_gradient_depth()));
- ArdourCanvas::Color darker = ArdourCanvas::hsva_to_color (h, s, v, a);
+ Color darker = hsva_to_color (h, s, v, a);
stops.push_back (std::make_pair (1.0, darker));
frame->set_gradient (stops, true);
frame_handle_end->set_x0 (pixel_width - (TimeAxisViewItem::GRAB_HANDLE_WIDTH));
frame_handle_end->set_x1 (pixel_width);
frame_handle_end->show();
+
+ frame_handle_start->raise_to_top ();
+ frame_handle_end->raise_to_top ();
}
}
}