diff options
author | David Robillard <d@drobilla.net> | 2008-11-22 20:55:55 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-11-22 20:55:55 +0000 |
commit | fb87e81926cc0487b5f0e165806a7cc95053635e (patch) | |
tree | 9d9af41e9e67dcbe2c21e5c7bcacc54b3bbdfa39 /src/gui | |
parent | ae9644045846190f13dda828e2f75115f2c8601f (diff) | |
download | ingen-fb87e81926cc0487b5f0e165806a7cc95053635e.tar.gz ingen-fb87e81926cc0487b5f0e165806a7cc95053635e.tar.bz2 ingen-fb87e81926cc0487b5f0e165806a7cc95053635e.zip |
Vertical or Horizontal (i.e. hide port labels or show port labels) canvas ordering option.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1770 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/NodeModule.cpp | 2 | ||||
-rw-r--r-- | src/gui/PatchCanvas.cpp | 8 | ||||
-rw-r--r-- | src/gui/PatchCanvas.hpp | 1 | ||||
-rw-r--r-- | src/gui/PatchPortModule.cpp | 4 | ||||
-rw-r--r-- | src/gui/PatchWindow.cpp | 10 |
5 files changed, 12 insertions, 13 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index c80137de..016a9b01 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -41,7 +41,7 @@ namespace GUI { NodeModule::NodeModule(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeModel> node) - : FlowCanvas::Module(canvas, node->path().name()) + : FlowCanvas::Module(canvas, node->path().name(), 0, 0, true, canvas->show_port_names()) , _node(node) , _gui_widget(NULL) , _gui_window(NULL) diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index 41794c74..1544b41b 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -291,10 +291,10 @@ void PatchCanvas::show_port_names(bool b) { _show_port_names = b; - for (ItemList::iterator m = _items.begin(); m != _items.end(); ++m) { - boost::shared_ptr<NodeModule> mod = boost::dynamic_pointer_cast<NodeModule>(*m); - if (mod) - mod->show_port_labels(b); + for (ItemList::iterator i = _items.begin(); i != _items.end(); ++i) { + boost::shared_ptr<Module> m = boost::dynamic_pointer_cast<Module>(*i); + if (m) + m->set_show_port_labels(b); } } diff --git a/src/gui/PatchCanvas.hpp b/src/gui/PatchCanvas.hpp index 127b5bd3..67553284 100644 --- a/src/gui/PatchCanvas.hpp +++ b/src/gui/PatchCanvas.hpp @@ -63,6 +63,7 @@ public: void arrange(bool use_length_hints); void show_human_names(bool show); void show_port_names(bool show); + bool show_port_names() const { return _show_port_names; } void add_plugin(SharedPtr<PluginModel> pm); void add_node(SharedPtr<NodeModel> nm); diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp index 89e19fea..ff482fb7 100644 --- a/src/gui/PatchPortModule.cpp +++ b/src/gui/PatchPortModule.cpp @@ -34,8 +34,8 @@ namespace GUI { PatchPortModule::PatchPortModule(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<PortModel> port) -: FlowCanvas::Module(canvas, port->path().name(), 0, 0, false), // FIXME: coords? - _port(port) + : FlowCanvas::Module(canvas, port->path().name(), 0, 0, false) // FIXME: coords? + , _port(port) { assert(canvas); assert(port); diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp index 7cd095f5..c2e9872d 100644 --- a/src/gui/PatchWindow.cpp +++ b/src/gui/PatchWindow.cpp @@ -602,14 +602,12 @@ PatchWindow::event_human_names_toggled() void PatchWindow::event_port_names_toggled() { - _view->canvas()->show_port_names(_menu_show_port_names->get_active()); if (_menu_show_port_names->get_active()) { - App::instance().configuration()->set_name_style(Configuration::NONE); + _view->canvas()->set_direction(Canvas::HORIZONTAL); + _view->canvas()->show_port_names(true); } else { - if (_menu_human_names->get_active()) - App::instance().configuration()->set_name_style(Configuration::HUMAN); - else - App::instance().configuration()->set_name_style(Configuration::PATH); + _view->canvas()->set_direction(Canvas::VERTICAL); + _view->canvas()->show_port_names(false); } } |