summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-07-19 21:46:38 +0000
committerCarl Hetherington <carl@carlh.net>2009-07-19 21:46:38 +0000
commit9f5b9f3c3ee1316b98f259f54214c02db2acd10c (patch)
treedeea98feeedcfcb07fb973957ba4a6c2aa50c399
parent82f31ffc796146389332295b51f27254e945fe01 (diff)
Outline highlighted labels in red.
git-svn-id: svn://localhost/ardour2/branches/3.0@5389 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/port_matrix_column_labels.cc40
-rw-r--r--gtk2_ardour/port_matrix_column_labels.h4
-rw-r--r--gtk2_ardour/port_matrix_labels.cc2
-rw-r--r--gtk2_ardour/port_matrix_labels.h4
-rw-r--r--gtk2_ardour/port_matrix_row_labels.cc32
-rw-r--r--gtk2_ardour/port_matrix_row_labels.h4
6 files changed, 44 insertions, 42 deletions
diff --git a/gtk2_ardour/port_matrix_column_labels.cc b/gtk2_ardour/port_matrix_column_labels.cc
index ba27120b57..8633070d69 100644
--- a/gtk2_ardour/port_matrix_column_labels.cc
+++ b/gtk2_ardour/port_matrix_column_labels.cc
@@ -193,7 +193,7 @@ PortMatrixColumnLabels::render (cairo_t* cr)
for (PortGroup::BundleList::const_iterator j = bundles.begin (); j != bundles.end(); ++j) {
Gdk::Color c = j->has_colour ? j->colour : get_a_bundle_colour (N);
- render_bundle_name (cr, c, x, 0, j->bundle);
+ render_bundle_name (cr, background_colour (), c, x, 0, j->bundle);
if (_matrix->show_only_bundles()) {
x += grid_spacing();
@@ -226,7 +226,7 @@ PortMatrixColumnLabels::render (cairo_t* cr)
for (uint32_t k = 0; k < j->bundle->nchannels(); ++k) {
Gdk::Color c = j->has_colour ? j->colour : get_a_bundle_colour (N);
- render_channel_name (cr, c, x, 0, ARDOUR::BundleChannel (j->bundle, k));
+ render_channel_name (cr, background_colour (), c, x, 0, ARDOUR::BundleChannel (j->bundle, k));
x += grid_spacing();
}
@@ -317,10 +317,10 @@ PortMatrixColumnLabels::port_name_shape (double xoff, double yoff) const
void
PortMatrixColumnLabels::render_bundle_name (
- cairo_t* cr, Gdk::Color colour, double xoff, double yoff, boost::shared_ptr<ARDOUR::Bundle> b
+ cairo_t* cr, Gdk::Color fg_colour, Gdk::Color bg_colour, double xoff, double yoff, boost::shared_ptr<ARDOUR::Bundle> b
)
{
- set_source_rgb (cr, colour);
+ set_source_rgb (cr, bg_colour);
double w = 0;
if (_matrix->show_only_bundles()) {
@@ -349,7 +349,7 @@ PortMatrixColumnLabels::render_bundle_name (
cairo_line_to (cr, x_, y_);
cairo_line_to (cr, xoff, y);
cairo_fill_preserve (cr);
- set_source_rgb (cr, background_colour());
+ set_source_rgb (cr, fg_colour);
cairo_set_line_width (cr, label_border_width());
cairo_stroke (cr);
@@ -386,7 +386,7 @@ PortMatrixColumnLabels::render_bundle_name (
void
PortMatrixColumnLabels::render_channel_name (
- cairo_t* cr, Gdk::Color colour, double xoff, double yoff, ARDOUR::BundleChannel const &bc
+ cairo_t* cr, Gdk::Color fg_colour, Gdk::Color bg_colour, double xoff, double yoff, ARDOUR::BundleChannel const &bc
)
{
vector<pair<double, double> > const shape = port_name_shape (xoff, yoff);
@@ -397,9 +397,9 @@ PortMatrixColumnLabels::render_channel_name (
}
cairo_line_to (cr, shape[0].first, shape[0].second);
- set_source_rgb (cr, colour);
+ set_source_rgb (cr, bg_colour);
cairo_fill_preserve (cr);
- set_source_rgb (cr, background_colour());
+ set_source_rgb (cr, fg_colour);
cairo_set_line_width (cr, label_border_width());
cairo_stroke (cr);
@@ -456,10 +456,10 @@ PortMatrixColumnLabels::queue_draw_for (ARDOUR::BundleChannel const & bc)
if (_matrix->show_only_bundles()) {
_body->queue_draw_area (
- component_to_parent_x (channel_x (bc)),
- component_to_parent_y (0),
- grid_spacing() + _height * tan (angle()),
- _height
+ component_to_parent_x (channel_x (bc)) - 1,
+ component_to_parent_y (0) - 1,
+ grid_spacing() + _height * tan (angle()) + 2,
+ _height + 2
);
} else {
@@ -471,10 +471,10 @@ PortMatrixColumnLabels::queue_draw_for (ARDOUR::BundleChannel const & bc)
if (_matrix->arrangement() == PortMatrix::TOP_TO_RIGHT) {
_body->queue_draw_area (
- component_to_parent_x (x),
- component_to_parent_y (_height - h),
- grid_spacing() + lc * cos (angle()),
- h
+ component_to_parent_x (x) - 1,
+ component_to_parent_y (_height - h) - 1,
+ grid_spacing() + lc * cos (angle()) + 2,
+ h + 2
);
} else if (_matrix->arrangement() == PortMatrix::LEFT_TO_BOTTOM) {
@@ -482,10 +482,10 @@ PortMatrixColumnLabels::queue_draw_for (ARDOUR::BundleChannel const & bc)
double const x_ = x + slanted_height() / tan (angle()) - lc * cos (angle());
_body->queue_draw_area (
- component_to_parent_x (x_),
- component_to_parent_y (0),
- grid_spacing() + lc * cos (angle()),
- h
+ component_to_parent_x (x_) - 1,
+ component_to_parent_y (0) - 1,
+ grid_spacing() + lc * cos (angle()) + 2,
+ h + 2
);
}
diff --git a/gtk2_ardour/port_matrix_column_labels.h b/gtk2_ardour/port_matrix_column_labels.h
index c735eb7e39..8dba7801be 100644
--- a/gtk2_ardour/port_matrix_column_labels.h
+++ b/gtk2_ardour/port_matrix_column_labels.h
@@ -49,8 +49,8 @@ public:
}
private:
- void render_bundle_name (cairo_t *, Gdk::Color, double, double, boost::shared_ptr<ARDOUR::Bundle>);
- void render_channel_name (cairo_t *, Gdk::Color, double, double, ARDOUR::BundleChannel const &);
+ void render_bundle_name (cairo_t *, Gdk::Color, Gdk::Color, double, double, boost::shared_ptr<ARDOUR::Bundle>);
+ void render_channel_name (cairo_t *, Gdk::Color, Gdk::Color, double, double, ARDOUR::BundleChannel const &);
double channel_x (ARDOUR::BundleChannel const &) const;
double channel_y (ARDOUR::BundleChannel const &) const;
void queue_draw_for (ARDOUR::BundleChannel const &);
diff --git a/gtk2_ardour/port_matrix_labels.cc b/gtk2_ardour/port_matrix_labels.cc
index d29a9244df..82909a5d05 100644
--- a/gtk2_ardour/port_matrix_labels.cc
+++ b/gtk2_ardour/port_matrix_labels.cc
@@ -28,6 +28,7 @@ PortMatrixLabels::draw_extra (cairo_t* cr)
if (_matrix->show_only_bundles()) {
render_bundle_name (
cr,
+ mouseover_line_colour(),
highlighted_channel_colour(),
component_to_parent_x (channel_x (*i)),
component_to_parent_y (channel_y (*i)),
@@ -36,6 +37,7 @@ PortMatrixLabels::draw_extra (cairo_t* cr)
} else {
render_channel_name (
cr,
+ mouseover_line_colour(),
highlighted_channel_colour(),
component_to_parent_x (channel_x (*i)),
component_to_parent_y (channel_y (*i)),
diff --git a/gtk2_ardour/port_matrix_labels.h b/gtk2_ardour/port_matrix_labels.h
index 9ace58b3e8..f543166031 100644
--- a/gtk2_ardour/port_matrix_labels.h
+++ b/gtk2_ardour/port_matrix_labels.h
@@ -38,8 +38,8 @@ public:
void add_channel_highlight (ARDOUR::BundleChannel const &);
private:
- virtual void render_channel_name (cairo_t *, Gdk::Color, double, double, ARDOUR::BundleChannel const &) = 0;
- virtual void render_bundle_name (cairo_t *, Gdk::Color, double, double, boost::shared_ptr<ARDOUR::Bundle>) = 0;
+ virtual void render_channel_name (cairo_t *, Gdk::Color, Gdk::Color, double, double, ARDOUR::BundleChannel const &) = 0;
+ virtual void render_bundle_name (cairo_t *, Gdk::Color, Gdk::Color, double, double, boost::shared_ptr<ARDOUR::Bundle>) = 0;
virtual double channel_x (ARDOUR::BundleChannel const &) const = 0;
virtual double channel_y (ARDOUR::BundleChannel const &) const = 0;
virtual void queue_draw_for (ARDOUR::BundleChannel const &) = 0;
diff --git a/gtk2_ardour/port_matrix_row_labels.cc b/gtk2_ardour/port_matrix_row_labels.cc
index 8d7410d319..eb3b5f4ce7 100644
--- a/gtk2_ardour/port_matrix_row_labels.cc
+++ b/gtk2_ardour/port_matrix_row_labels.cc
@@ -161,12 +161,12 @@ PortMatrixRowLabels::render (cairo_t* cr)
PortGroup::BundleList const & bundles = (*i)->bundles ();
for (PortGroup::BundleList::const_iterator j = bundles.begin(); j != bundles.end(); ++j) {
- render_bundle_name (cr, j->has_colour ? j->colour : get_a_bundle_colour (N), 0, y, j->bundle);
+ render_bundle_name (cr, background_colour (), j->has_colour ? j->colour : get_a_bundle_colour (N), 0, y, j->bundle);
if (!_matrix->show_only_bundles()) {
for (uint32_t k = 0; k < j->bundle->nchannels(); ++k) {
Gdk::Color c = j->has_colour ? j->colour : get_a_bundle_colour (M);
- render_channel_name (cr, c, 0, y, ARDOUR::BundleChannel (j->bundle, k));
+ render_channel_name (cr, background_colour (), c, 0, y, ARDOUR::BundleChannel (j->bundle, k));
y += grid_spacing();
++M;
}
@@ -276,16 +276,16 @@ PortMatrixRowLabels::port_name_x () const
void
PortMatrixRowLabels::render_bundle_name (
- cairo_t* cr, Gdk::Color colour, double xoff, double yoff, boost::shared_ptr<ARDOUR::Bundle> b
+ cairo_t* cr, Gdk::Color fg_colour, Gdk::Color bg_colour, double xoff, double yoff, boost::shared_ptr<ARDOUR::Bundle> b
)
{
double const x = bundle_name_x ();
int const n = _matrix->show_only_bundles() ? 1 : b->nchannels();
- set_source_rgb (cr, colour);
+ set_source_rgb (cr, bg_colour);
cairo_rectangle (cr, xoff + x, yoff, _longest_bundle_name + name_pad() * 2, grid_spacing() * n);
cairo_fill_preserve (cr);
- set_source_rgb (cr, background_colour());
+ set_source_rgb (cr, fg_colour);
cairo_set_line_width (cr, label_border_width ());
cairo_stroke (cr);
@@ -305,13 +305,13 @@ PortMatrixRowLabels::render_bundle_name (
void
PortMatrixRowLabels::render_channel_name (
- cairo_t* cr, Gdk::Color colour, double xoff, double yoff, ARDOUR::BundleChannel const& bc
+ cairo_t* cr, Gdk::Color fg_colour, Gdk::Color bg_colour, double xoff, double yoff, ARDOUR::BundleChannel const& bc
)
{
- set_source_rgb (cr, colour);
+ set_source_rgb (cr, bg_colour);
cairo_rectangle (cr, port_name_x() + xoff, yoff, _longest_port_name + name_pad() * 2, grid_spacing());
cairo_fill_preserve (cr);
- set_source_rgb (cr, background_colour());
+ set_source_rgb (cr, fg_colour);
cairo_set_line_width (cr, label_border_width ());
cairo_stroke (cr);
@@ -343,17 +343,17 @@ PortMatrixRowLabels::queue_draw_for (ARDOUR::BundleChannel const & bc)
if (_matrix->show_only_bundles()) {
_body->queue_draw_area (
- component_to_parent_x (bundle_name_x()),
- component_to_parent_y (channel_y (bc)),
- _longest_bundle_name + name_pad() * 2,
- grid_spacing()
+ component_to_parent_x (bundle_name_x()) - 1,
+ component_to_parent_y (channel_y (bc)) - 1,
+ _longest_bundle_name + name_pad() * 2 + 2,
+ grid_spacing() + 2
);
} else {
_body->queue_draw_area (
- component_to_parent_x (port_name_x()),
- component_to_parent_y (channel_y (bc)),
- _longest_port_name + name_pad() * 2,
- grid_spacing()
+ component_to_parent_x (port_name_x()) - 1,
+ component_to_parent_y (channel_y (bc)) - 1,
+ _longest_port_name + name_pad() * 2 + 2,
+ grid_spacing() + 2
);
}
}
diff --git a/gtk2_ardour/port_matrix_row_labels.h b/gtk2_ardour/port_matrix_row_labels.h
index 60a699f5f2..9fcb1ca831 100644
--- a/gtk2_ardour/port_matrix_row_labels.h
+++ b/gtk2_ardour/port_matrix_row_labels.h
@@ -52,8 +52,8 @@ public:
void mouseover_changed (PortMatrixNode const &);
private:
- void render_channel_name (cairo_t *, Gdk::Color, double, double, ARDOUR::BundleChannel const &);
- void render_bundle_name (cairo_t *, Gdk::Color, double, double, boost::shared_ptr<ARDOUR::Bundle>);
+ void render_channel_name (cairo_t *, Gdk::Color, Gdk::Color, double, double, ARDOUR::BundleChannel const &);
+ void render_bundle_name (cairo_t *, Gdk::Color, Gdk::Color, double, double, boost::shared_ptr<ARDOUR::Bundle>);
double channel_x (ARDOUR::BundleChannel const &) const;
double channel_y (ARDOUR::BundleChannel const &) const;