From be79bc7916f116a24a9f3bc9451780e5d6f10cc7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 4 Dec 2009 12:49:58 +0000 Subject: Tweak mouseover on port matrix. git-svn-id: svn://localhost/ardour2/branches/3.0@6278 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/port_matrix_row_labels.cc | 50 ++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 21 deletions(-) (limited to 'gtk2_ardour') 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 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 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; } } -- cgit v1.2.3