Improve resize behaviour of port matrices when their content size changes.
authorCarl Hetherington <carl@carlh.net>
Tue, 27 Jul 2010 02:10:27 +0000 (02:10 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 27 Jul 2010 02:10:27 +0000 (02:10 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7507 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/io_selector.cc
gtk2_ardour/port_matrix.cc

index f90ce88545ecb2f86735e60d7ac6303e2441a2ae..9399a6aaa7c5000c166b0e0219ba970c7baaf218 100644 (file)
@@ -218,9 +218,7 @@ IOSelectorWindow::IOSelectorWindow (ARDOUR::Session* session, boost::shared_ptr<
        set_name ("IOSelectorWindow2");
        set_title (_("I/O selector"));
 
-       Gtk::Alignment* alignment = manage(new Gtk::Alignment(0.5, 0.5, 0.0, 0.0));
-       alignment->add (_selector);
-       add (*alignment);
+       add (_selector);
 
        set_position (Gtk::WIN_POS_MOUSE);
 
index 06f869b67593078394d6dfee4d2febabc8979258..f3559cbb21374d8f853827370181e57cfbe0dbf4 100644 (file)
@@ -304,7 +304,7 @@ PortMatrix::select_arrangement ()
                _hlabel.set_label (_("<b>Destinations</b>"));
                _vlabel.set_angle (90);
 
-               attach (*_body, 1, 2, 0, 1);
+               attach (*_body, 1, 2, 0, 1, FILL | EXPAND, FILL | EXPAND);
                attach (_vscroll, 2, 3, 0, 1, SHRINK);
                attach (_hscroll, 1, 2, 2, 3, FILL | EXPAND, SHRINK);
                attach (_vbox, 0, 1, 0, 1, SHRINK);
@@ -322,7 +322,7 @@ PortMatrix::select_arrangement ()
                _vlabel.set_label (_("<b>Destinations</b>"));
                _vlabel.set_angle (-90);
 
-               attach (*_body, 0, 1, 1, 2);
+               attach (*_body, 0, 1, 1, 2, FILL | EXPAND, FILL | EXPAND);
                attach (_vscroll, 2, 3, 1, 2, SHRINK);
                attach (_hscroll, 0, 1, 2, 3, FILL | EXPAND, SHRINK);
                attach (_vbox, 1, 2, 1, 2, SHRINK);
@@ -587,8 +587,8 @@ PortMatrix::max_size () const
 {
        pair<uint32_t, uint32_t> m = _body->max_size ();
 
-       m.first += _vscroll.get_width ();
-       m.second += _hscroll.get_height ();
+       m.first += _vscroll.get_width () + _vbox.get_width () + 4;
+       m.second += _hscroll.get_height () + _hbox.get_height () + 4;
 
        return m;
 }
@@ -787,6 +787,8 @@ PortMatrix::body_dimensions_changed ()
                _vspacer.hide ();
        }
 
+       pair<uint32_t, uint32_t> const m = max_size ();
+       resize_window_to_proportion_of_monitor (_parent, m.first, m.second);
 }