summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-07-22 01:28:31 +0000
committerCarl Hetherington <carl@carlh.net>2009-07-22 01:28:31 +0000
commit272cad6241ababb0e2033f27e0511596b3e32b15 (patch)
tree2f76ee12d5d0a28846b29bdcf811369c4f0d386a /gtk2_ardour/port_matrix.cc
parent718659344277514acd05fbb8ffee30134a6cf66a (diff)
Various fixups to bundle manager. Add a separator between the benign and more serious menu options on the port matrix context menu. Finally (maybe) fix port matrix sizing issues relatively nicely.
git-svn-id: svn://localhost/ardour2/branches/3.0@5409 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_matrix.cc')
-rw-r--r--gtk2_ardour/port_matrix.cc37
1 files changed, 26 insertions, 11 deletions
diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc
index a415cf5e91..5e5bf7e4ec 100644
--- a/gtk2_ardour/port_matrix.cc
+++ b/gtk2_ardour/port_matrix.cc
@@ -24,6 +24,7 @@
#include <gtkmm/menu.h>
#include <gtkmm/menushell.h>
#include <gtkmm/menu_elems.h>
+#include <gtkmm/window.h>
#include "ardour/bundle.h"
#include "ardour/types.h"
#include "ardour/session.h"
@@ -42,9 +43,10 @@ using namespace ARDOUR;
* @param session Our session.
* @param type Port type that we are handling.
*/
-PortMatrix::PortMatrix (Session& session, DataType type)
+PortMatrix::PortMatrix (Window* parent, Session& session, DataType type)
: Table (2, 2),
_session (session),
+ _parent (parent),
_type (type),
_menu (0),
_arrangement (TOP_TO_RIGHT),
@@ -280,15 +282,6 @@ PortMatrix::popup_menu (
sub.push_back (MenuElem (buf, bind (mem_fun (*this, &PortMatrix::add_channel_proxy), w)));
}
- if (can_remove_channels (bc[dim].bundle)) {
- snprintf (buf, sizeof (buf), _("Remove '%s'"), bc[dim].bundle->channel_name (bc[dim].channel).c_str());
- sub.push_back (
- MenuElem (
- buf,
- bind (mem_fun (*this, &PortMatrix::remove_channel_proxy), w, bc[dim].channel)
- )
- );
- }
if (can_rename_channels (bc[dim].bundle)) {
snprintf (buf, sizeof (buf), _("Rename '%s'..."), bc[dim].bundle->channel_name (bc[dim].channel).c_str());
@@ -299,7 +292,19 @@ PortMatrix::popup_menu (
)
);
}
+
+ sub.push_back (SeparatorElem ());
+ if (can_remove_channels (bc[dim].bundle)) {
+ snprintf (buf, sizeof (buf), _("Remove '%s'"), bc[dim].bundle->channel_name (bc[dim].channel).c_str());
+ sub.push_back (
+ MenuElem (
+ buf,
+ bind (mem_fun (*this, &PortMatrix::remove_channel_proxy), w, bc[dim].channel)
+ )
+ );
+ }
+
if (_show_only_bundles) {
snprintf (buf, sizeof (buf), _("%s all"), disassociation_verb().c_str());
} else {
@@ -473,7 +478,17 @@ PortMatrix::max_size () const
void
PortMatrix::setup_max_size ()
{
- MaxSizeChanged ();
+ if (!_parent) {
+ return;
+ }
+
+ pair<uint32_t, uint32_t> const m = max_size ();
+
+ GdkGeometry g;
+ g.max_width = m.first;
+ g.max_height = m.second;
+
+ _parent->set_geometry_hints (*this, g, Gdk::HINT_MAX_SIZE);
}
bool