summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-12-04 13:06:13 +0000
committerCarl Hetherington <carl@carlh.net>2009-12-04 13:06:13 +0000
commit4a836618f3f9eb28848353e072315da1f2ccfbf0 (patch)
tree5207cdc675cbdf7d3d704a750726f083501dc6af /gtk2_ardour/port_matrix.cc
parentbe79bc7916f116a24a9f3bc9451780e5d6f10cc7 (diff)
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
Diffstat (limited to 'gtk2_ardour/port_matrix.cc')
-rw-r--r--gtk2_ardour/port_matrix.cc20
1 files 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;
}