Outline highlighted labels in red.
authorCarl Hetherington <carl@carlh.net>
Sun, 19 Jul 2009 21:46:38 +0000 (21:46 +0000)
committerCarl Hetherington <carl@carlh.net>
Sun, 19 Jul 2009 21:46:38 +0000 (21:46 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@5389 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/port_matrix_column_labels.cc
gtk2_ardour/port_matrix_column_labels.h
gtk2_ardour/port_matrix_labels.cc
gtk2_ardour/port_matrix_labels.h
gtk2_ardour/port_matrix_row_labels.cc
gtk2_ardour/port_matrix_row_labels.h

index ba27120b57e27d75136ac0630fa6699105ca69a4..8633070d690fae9a87a89dd08a53b546ffc28a60 100644 (file)
@@ -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
                                );
                        
                }
index c735eb7e394c130cc1d3ac206dbc3d2818eb6985..8dba7801befa6e63788eeab4adad1b764ebb46a6 100644 (file)
@@ -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 &);
index d29a9244dfba575cc37734519112e0c119d5da0e..82909a5d05d1e8e8bfd679efdc2e85a0fe8a2a4f 100644 (file)
@@ -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)),
index 9ace58b3e8a0539ac1a59dda38bd76fb7d86da04..f543166031447f30f33b91a2c253e0da8a1ea838 100644 (file)
@@ -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;
index 8d7410d319fee99eda20fc68f5910b69a5f8b961..eb3b5f4ce7980dcec142e9f8c772f3370b730b22 100644 (file)
@@ -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
                                );
                }
        }
index 60a699f5f259f135c8ab23c54e532ea9d15ee5e1..9fcb1ca831870ee097ccad85b5879ea1aef9170f 100644 (file)
@@ -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;