From fb87e81926cc0487b5f0e165806a7cc95053635e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 22 Nov 2008 20:55:55 +0000 Subject: 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 --- src/gui/NodeModule.cpp | 2 +- src/gui/PatchCanvas.cpp | 8 ++++---- src/gui/PatchCanvas.hpp | 1 + src/gui/PatchPortModule.cpp | 4 ++-- src/gui/PatchWindow.cpp | 10 ++++------ 5 files changed, 12 insertions(+), 13 deletions(-) (limited to 'src') 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 canvas, SharedPtr 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 mod = boost::dynamic_pointer_cast(*m); - if (mod) - mod->show_port_labels(b); + for (ItemList::iterator i = _items.begin(); i != _items.end(); ++i) { + boost::shared_ptr m = boost::dynamic_pointer_cast(*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 pm); void add_node(SharedPtr 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 canvas, SharedPtr 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); } } -- cgit v1.2.1