summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2015-04-05 03:35:27 +1000
committernick_m <mainsbridge@gmail.com>2015-04-05 03:35:27 +1000
commit7cf04e2b9d5ccbec5059c5f2e1af6aaf1f5dc657 (patch)
treec2034698999a591296d12906998e28f4bad329e8
parenta45feecb1b6a169946195117517df9759aebc9ae (diff)
Port matrix useability fix.
When a page has changed, leave the adjustment where it is on the axis whose size remains the same. On the changed axis, set the scroller to zero.
-rw-r--r--gtk2_ardour/port_matrix.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc
index ebf6413d39..40cc80a350 100644
--- a/gtk2_ardour/port_matrix.cc
+++ b/gtk2_ardour/port_matrix.cc
@@ -248,17 +248,26 @@ PortMatrix::setup_scrollbars ()
{
Adjustment* a = _hscroll.get_adjustment ();
a->set_lower (0);
- a->set_upper (_body->full_scroll_width());
a->set_page_size (_body->alloc_scroll_width());
a->set_step_increment (32);
a->set_page_increment (128);
+ /* Set the adjustment to zero if the size has changed.*/
+ if (a->get_upper() != _body->full_scroll_width()) {
+ a->set_upper (_body->full_scroll_width());
+ a->set_value (0);
+ }
+
a = _vscroll.get_adjustment ();
a->set_lower (0);
- a->set_upper (_body->full_scroll_height());
a->set_page_size (_body->alloc_scroll_height());
a->set_step_increment (32);
a->set_page_increment (128);
+
+ if (a->get_upper() != _body->full_scroll_height()) {
+ a->set_upper (_body->full_scroll_height());
+ a->set_value (0);
+ }
}
/** Disassociate all of our ports from each other */