diff options
author | Carl Hetherington <carl@carlh.net> | 2009-07-19 19:07:31 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-07-19 19:07:31 +0000 |
commit | 6da5dd6d41df9e3d05b9b8cceaf1b671b4e21141 (patch) | |
tree | 299692da802c9bd7a23c63cb801e69f44733eea1 /gtk2_ardour/port_matrix.cc | |
parent | af5b9f92a52f08d154ad84c60c61823cb45b62db (diff) |
Port matrix tweaks: scroll wheel support; use the correct verb for disassociation in the menu; fixes for gaps appearing when groups are hidden.
git-svn-id: svn://localhost/ardour2/branches/3.0@5382 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_matrix.cc')
-rw-r--r-- | gtk2_ardour/port_matrix.cc | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index 8727c1f677..001d06081f 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -30,6 +30,7 @@ #include "ardour/route.h" #include "port_matrix.h" #include "port_matrix_body.h" +#include "port_matrix_component.h" #include "i18n.h" using namespace std; @@ -319,11 +320,13 @@ PortMatrix::popup_menu ( boost::weak_ptr<ARDOUR::Bundle> w (bc[dim].bundle); if (_show_only_bundles) { - snprintf (buf, sizeof (buf), _("Disassociate all from '%s'"), bc[dim].bundle->name().c_str()); + snprintf (buf, sizeof (buf), _("%s all from '%s'"), disassociation_verb().c_str(), bc[dim].bundle->name().c_str()); } else { snprintf ( - buf, sizeof (buf), _("Disassociate all from '%s/%s'"), - bc[dim].bundle->name().c_str(), bc[dim].bundle->channel_name (bc[dim].channel).c_str() + buf, sizeof (buf), _("%s all from '%s/%s'"), + disassociation_verb().c_str(), + bc[dim].bundle->name().c_str(), + bc[dim].bundle->channel_name (bc[dim].channel).c_str() ); } @@ -464,3 +467,27 @@ PortMatrix::setup_max_size () { MaxSizeChanged (); } + +bool +PortMatrix::on_scroll_event (GdkEventScroll* ev) +{ + double const h = _hscroll.get_value (); + double const v = _vscroll.get_value (); + + switch (ev->direction) { + case GDK_SCROLL_UP: + _vscroll.set_value (v - PortMatrixComponent::grid_spacing ()); + break; + case GDK_SCROLL_DOWN: + _vscroll.set_value (v + PortMatrixComponent::grid_spacing ()); + break; + case GDK_SCROLL_LEFT: + _hscroll.set_value (h - PortMatrixComponent::grid_spacing ()); + break; + case GDK_SCROLL_RIGHT: + _hscroll.set_value (h + PortMatrixComponent::grid_spacing ()); + break; + } + + return true; +} |