From 4969266d06da72536161b268306e06a606062fff Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 6 Apr 2012 11:18:22 +0000 Subject: [PATCH] fix some packing issues in the monitor section when using high-channel-count master/monitor busses (eg. ambi) git-svn-id: svn://localhost/ardour2/branches/3.0@11805 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/monitor_section.cc | 14 +++++++++----- gtk2_ardour/monitor_section.h | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/monitor_section.cc b/gtk2_ardour/monitor_section.cc index 3b78e34612..25e4034182 100644 --- a/gtk2_ardour/monitor_section.cc +++ b/gtk2_ardour/monitor_section.cc @@ -36,6 +36,8 @@ MonitorSection::MonitorSection (Session* s) : AxisView (s) , RouteUI (s) , _tearoff (0) + , channel_table_viewport (*channel_table_scroller.get_hadjustment(), + *channel_table_scroller.get_vadjustment ()) , gain_control (0) , dim_control (0) , solo_boost_control (0) @@ -257,7 +259,8 @@ MonitorSection::MonitorSection (Session* s) channel_table_scroller.set_size_request (-1, 150); channel_table_scroller.set_shadow_type (Gtk::SHADOW_NONE); channel_table_scroller.show (); - + channel_table_scroller.add (channel_table_viewport); + channel_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL); channel_size_group->add_widget (channel_table_header); channel_size_group->add_widget (channel_table); @@ -357,23 +360,24 @@ MonitorSection::set_session (Session* s) if (channel_table_scroller.get_parent()) { /* scroller is packed, so remove it */ channel_table_packer.remove (channel_table_scroller); - /* remove the table_hpacker from the scroller */ - channel_table_scroller.remove (); } - if (table_hpacker.get_parent ()) { + if (table_hpacker.get_parent () == &channel_table_packer) { /* this occurs when the table hpacker is directly packed, so remove it. */ channel_table_packer.remove (table_hpacker); + } else if (table_hpacker.get_parent()) { + channel_table_viewport.remove (); } if (_monitor->output_streams().n_audio() > 7) { /* put the table into a scrolled window, and then put * that into the channel vpacker, after the table header */ - channel_table_scroller.add (table_hpacker); + channel_table_viewport.add (table_hpacker); channel_table_packer.pack_start (channel_table_scroller, true, true); + channel_table_viewport.show (); channel_table_scroller.show (); } else { diff --git a/gtk2_ardour/monitor_section.h b/gtk2_ardour/monitor_section.h index 185720856b..f7848a3f01 100644 --- a/gtk2_ardour/monitor_section.h +++ b/gtk2_ardour/monitor_section.h @@ -59,6 +59,7 @@ class MonitorSection : public RouteUI Gtk::Table channel_table; Gtk::Table channel_table_header; Gtk::ScrolledWindow channel_table_scroller; + Gtk::Viewport channel_table_viewport; Glib::RefPtr channel_size_group; struct ChannelButtonSet {