summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix_row_labels.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/port_matrix_row_labels.cc')
-rw-r--r--gtk2_ardour/port_matrix_row_labels.cc50
1 files changed, 29 insertions, 21 deletions
diff --git a/gtk2_ardour/port_matrix_row_labels.cc b/gtk2_ardour/port_matrix_row_labels.cc
index 2ba43ba400..6528f31d76 100644
--- a/gtk2_ardour/port_matrix_row_labels.cc
+++ b/gtk2_ardour/port_matrix_row_labels.cc
@@ -296,34 +296,42 @@ PortMatrixRowLabels::motion (double x, double y)
{
ARDOUR::BundleChannel const w = position_to_channel (y, x, _matrix->visible_rows());
- if (w.bundle == 0) {
- /* not over any bundle */
- _body->set_mouseover (PortMatrixNode ());
- return;
- }
-
uint32_t const bw = _longest_bundle_name + 2 * name_pad();
- if (
- (_matrix->arrangement() == PortMatrix::LEFT_TO_BOTTOM && x < bw) ||
- (_matrix->arrangement() == PortMatrix::TOP_TO_RIGHT && x > (_width - bw))
-
- ) {
+ bool done = false;
- /* if the mouse is over a bundle name, highlight all channels in the bundle */
+ if (w.bundle) {
- list<PortMatrixNode> n;
+ if (
+ (_matrix->arrangement() == PortMatrix::LEFT_TO_BOTTOM && x < bw) ||
+ (_matrix->arrangement() == PortMatrix::TOP_TO_RIGHT && x > (_width - bw) && x < _width)
+
+ ) {
- for (uint32_t i = 0; i < w.bundle->nchannels(); ++i) {
- ARDOUR::BundleChannel const bc (w.bundle, i);
- n.push_back (PortMatrixNode (bc, ARDOUR::BundleChannel ()));
+ /* if the mouse is over a bundle name, highlight all channels in the bundle */
+
+ list<PortMatrixNode> n;
+
+ for (uint32_t i = 0; i < w.bundle->nchannels(); ++i) {
+ ARDOUR::BundleChannel const bc (w.bundle, i);
+ n.push_back (PortMatrixNode (bc, ARDOUR::BundleChannel ()));
+ }
+
+ _body->set_mouseover (n);
+ done = true;
+
+ } else if (x < _width) {
+
+ _body->set_mouseover (PortMatrixNode (w, ARDOUR::BundleChannel ()));
+ done = true;
+
}
- _body->set_mouseover (n);
-
- } else {
-
- _body->set_mouseover (PortMatrixNode (w, ARDOUR::BundleChannel ()));
+ }
+ if (!done) {
+ /* not over any bundle */
+ _body->set_mouseover (PortMatrixNode ());
+ return;
}
}