From 4a836618f3f9eb28848353e072315da1f2ccfbf0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 4 Dec 2009 13:06:13 +0000 Subject: [PATCH] Hide port matrix notebook tabs if there's only one. git-svn-id: svn://localhost/ardour2/branches/3.0@6279 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/port_matrix.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index 5a78d7f8d3..3a84910d49 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -82,7 +82,11 @@ PortMatrix::PortMatrix (Window* parent, Session& session, DataType type) _hlabel.set_alignment (0, 0.5); _hlabel.set_padding (16, 4); - show_all (); + _body->show (); + _vbox.show (); + _hbox.show (); + _vlabel.show (); + _hlabel.show (); } PortMatrix::~PortMatrix () @@ -174,8 +178,6 @@ PortMatrix::setup () setup_scrollbars (); setup_notebooks (); queue_draw (); - - show_all (); } void @@ -644,6 +646,18 @@ PortMatrix::setup_notebooks () if (v_current_page != -1 && _vnotebook.get_n_pages() > v_current_page) { _vnotebook.set_current_page (v_current_page); } + + if (_hnotebook.get_n_pages() <= 1) { + _hnotebook.hide (); + } else { + _hnotebook.show (); + } + + if (_vnotebook.get_n_pages() <= 1) { + _vnotebook.hide (); + } else { + _vnotebook.show (); + } _in_setup_notebooks = false; } -- 2.30.2