summaryrefslogtreecommitdiffstats
path: root/src/gui/GraphCanvas.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-02-17 03:41:45 +0000
committerDavid Robillard <d@drobilla.net>2015-02-17 03:41:45 +0000
commitf1c1d019c14ddb184078c79cd5d6a0631a644acd (patch)
tree8f625d85d8983a7fba5b2f2f7a0ec22a12e5d832 /src/gui/GraphCanvas.cpp
parentfb8f05cdd3bcb7c322d5d67dac009bf668e209df (diff)
downloadingen-f1c1d019c14ddb184078c79cd5d6a0631a644acd.tar.gz
ingen-f1c1d019c14ddb184078c79cd5d6a0631a644acd.tar.bz2
ingen-f1c1d019c14ddb184078c79cd5d6a0631a644acd.zip
Fix display of labels when port is created without.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5581 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/GraphCanvas.cpp')
-rw-r--r--src/gui/GraphCanvas.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp
index b06b47b1..1fe665e7 100644
--- a/src/gui/GraphCanvas.cpp
+++ b/src/gui/GraphCanvas.cpp
@@ -256,13 +256,30 @@ void
GraphCanvas::show_human_names(bool b)
{
_human_names = b;
+ _app.world()->conf().set("human-names", _app.forge().make(b));
+
for_each_node(show_module_human_names, &b);
}
+static void
+ensure_port_labels(GanvNode* node, void* data)
+{
+ if (GANV_IS_MODULE(node)) {
+ Ganv::Module* module = Glib::wrap(GANV_MODULE(node));
+ for (Ganv::Port* p : *module) {
+ Ingen::GUI::Port* port = dynamic_cast<Ingen::GUI::Port*>(p);
+ if (port) {
+ port->ensure_label();
+ }
+ }
+ }
+}
+
void
GraphCanvas::show_port_names(bool b)
{
ganv_canvas_set_direction(gobj(), b ? GANV_DIRECTION_RIGHT : GANV_DIRECTION_DOWN);
+ for_each_node(ensure_port_labels, &b);
}
void
@@ -314,7 +331,7 @@ GraphCanvas::remove_block(SPtr<const BlockModel> bm)
void
GraphCanvas::add_port(SPtr<const PortModel> pm)
{
- GraphPortModule* view = GraphPortModule::create(*this, pm, _human_names);
+ GraphPortModule* view = GraphPortModule::create(*this, pm);
_views.insert(std::make_pair(pm, view));
view->show();
}