summaryrefslogtreecommitdiffstats
path: root/src/libs/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/gui')
-rw-r--r--src/libs/gui/NodeMenu.hpp3
-rw-r--r--src/libs/gui/NodeModule.cpp2
-rw-r--r--src/libs/gui/PatchPortModule.cpp14
-rw-r--r--src/libs/gui/PatchPortModule.hpp7
-rw-r--r--src/libs/gui/Port.cpp5
-rw-r--r--src/libs/gui/PortMenu.hpp9
6 files changed, 31 insertions, 9 deletions
diff --git a/src/libs/gui/NodeMenu.hpp b/src/libs/gui/NodeMenu.hpp
index f0d30f4c..715cf6b9 100644
--- a/src/libs/gui/NodeMenu.hpp
+++ b/src/libs/gui/NodeMenu.hpp
@@ -35,7 +35,8 @@ class NodeControlWindow;
class NodePropertiesWindow;
class PatchCanvas;
-/** Controller for a Node.
+
+/** Menu for a Node.
*
* \ingroup GUI
*/
diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp
index d3bb9de3..ed05c859 100644
--- a/src/libs/gui/NodeModule.cpp
+++ b/src/libs/gui/NodeModule.cpp
@@ -208,7 +208,7 @@ void
NodeModule::gui_size_request(Gtk::Requisition* r)
{
if (r->width + 4 > _width)
- set_width(r->width + 4);
+ set_minimum_width(r->width + 4);
_gui_item->property_width() = _width - 4;
_gui_item->property_height() = r->height;
diff --git a/src/libs/gui/PatchPortModule.cpp b/src/libs/gui/PatchPortModule.cpp
index 863fc55e..f686079d 100644
--- a/src/libs/gui/PatchPortModule.cpp
+++ b/src/libs/gui/PatchPortModule.cpp
@@ -15,8 +15,8 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "PatchPortModule.hpp"
#include <cassert>
+#include "PatchPortModule.hpp"
#include "interface/EngineInterface.hpp"
#include "client/PatchModel.hpp"
#include "client/NodeModel.hpp"
@@ -27,6 +27,7 @@
#include "RenameWindow.hpp"
#include "PatchWindow.hpp"
#include "WindowFactory.hpp"
+#include "PortMenu.hpp"
namespace Ingen {
namespace GUI {
@@ -85,6 +86,17 @@ PatchPortModule::create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<PortMod
void
+PatchPortModule::create_menu()
+{
+ Glib::RefPtr<Gnome::Glade::Xml> xml = GladeFactory::new_glade_reference();
+ xml->get_widget_derived("object_menu", _menu);
+ _menu->init(_port);
+
+ set_menu(_menu);
+}
+
+
+void
PatchPortModule::store_location()
{
const float x = static_cast<float>(property_x());
diff --git a/src/libs/gui/PatchPortModule.hpp b/src/libs/gui/PatchPortModule.hpp
index 7a420a44..8f3a3fc6 100644
--- a/src/libs/gui/PatchPortModule.hpp
+++ b/src/libs/gui/PatchPortModule.hpp
@@ -38,6 +38,7 @@ namespace GUI {
class PatchCanvas;
class Port;
+class PortMenu;
/** A "module" to represent a patch's port on it's own canvas.
@@ -62,9 +63,11 @@ protected:
PatchPortModule(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<PortModel> port);
void metadata_update(const string& key, const Raul::Atom& value);
+ void create_menu();
- SharedPtr<PortModel> _port;
- boost::shared_ptr<Port> _patch_port; ///< Port on this 'anonymous' module
+ SharedPtr<PortModel> _port;
+ PortMenu* _menu;
+ SharedPtr<Port> _patch_port; ///< Port on this 'anonymous' module
};
diff --git a/src/libs/gui/Port.cpp b/src/libs/gui/Port.cpp
index 228e4598..ccd9652c 100644
--- a/src/libs/gui/Port.cpp
+++ b/src/libs/gui/Port.cpp
@@ -18,6 +18,7 @@
#include <cassert>
#include <iostream>
#include "interface/EngineInterface.hpp"
+#include "flowcanvas/Module.hpp"
#include "client/PatchModel.hpp"
#include "client/PortModel.hpp"
#include "client/ControlModel.hpp"
@@ -44,6 +45,9 @@ Port::Port(boost::shared_ptr<FlowCanvas::Module> module, SharedPtr<PortModel> pm
{
assert(module);
assert(_port_model);
+
+ delete _menu;
+ _menu = NULL;
_port_model->signal_renamed.connect(sigc::mem_fun(this, &Port::renamed));
@@ -83,6 +87,7 @@ void
Port::renamed()
{
set_name(_port_model->path().name());
+ module().lock()->resize();
}
diff --git a/src/libs/gui/PortMenu.hpp b/src/libs/gui/PortMenu.hpp
index aa520ebc..e1079f0d 100644
--- a/src/libs/gui/PortMenu.hpp
+++ b/src/libs/gui/PortMenu.hpp
@@ -15,8 +15,8 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef NODEMENU_H
-#define NODEMENU_H
+#ifndef PORTMENU_H
+#define PORTMENU_H
#include <string>
#include <gtkmm.h>
@@ -35,7 +35,8 @@ class PortControlWindow;
class PortPropertiesWindow;
class PatchCanvas;
-/** Controller for a Port.
+
+/** Menu for a Port.
*
* \ingroup GUI
*/
@@ -51,4 +52,4 @@ public:
} // namespace GUI
} // namespace Ingen
-#endif // NODEMENU_H
+#endif // PORTMENU_H