summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix_row_labels.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-12-04 12:49:58 +0000
committerCarl Hetherington <carl@carlh.net>2009-12-04 12:49:58 +0000
commitbe79bc7916f116a24a9f3bc9451780e5d6f10cc7 (patch)
treeda4b4b27773a8f7e0679fab35f56ce14cf33231f /gtk2_ardour/port_matrix_row_labels.cc
parent24f0f5ecbc8fe7ce71a40e9f1241bec3f3958ae6 (diff)
Tweak mouseover on port matrix.
git-svn-id: svn://localhost/ardour2/branches/3.0@6278 d708f5d6-7413-0410-9779-e7cbd77b26cf
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;
}
}