summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-06-09 03:41:17 +0000
committerDavid Robillard <d@drobilla.net>2011-06-09 03:41:17 +0000
commit49bd2b972d10cfab035805d7ffae77e056569c66 (patch)
treead97aa85fb76051441addf97d1d9815bc93021d9 /src
parentd42b83ffe581651886ca0874b6b75dcbb6127aea (diff)
downloadingen-49bd2b972d10cfab035805d7ffae77e056569c66.tar.gz
ingen-49bd2b972d10cfab035805d7ffae77e056569c66.tar.bz2
ingen-49bd2b972d10cfab035805d7ffae77e056569c66.zip
Automatically resize modules at update time as necessary.
This avoids the huge multiple resize performance problems of the past without requiring the user to manually resize modules. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3375 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/gui/NodeModule.cpp16
-rw-r--r--src/gui/NodeModule.hpp2
-rw-r--r--src/gui/PatchPortModule.cpp5
3 files changed, 5 insertions, 18 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index ebbca29a..e634793c 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -53,7 +53,7 @@ NodeModule::NodeModule(PatchCanvas& canvas,
assert(_node);
node->signal_new_port().connect(
- sigc::bind(sigc::mem_fun(this, &NodeModule::new_port_view), true));
+ sigc::mem_fun(this, &NodeModule::new_port_view));
node->signal_removed_port().connect(
sigc::hide_return(sigc::mem_fun(this, &NodeModule::delete_port_view)));
node->signal_property().connect(
@@ -105,14 +105,12 @@ NodeModule::create(PatchCanvas& canvas,
for (NodeModel::Ports::const_iterator p = node->ports().begin();
p != node->ports().end(); ++p)
- ret->new_port_view(*p, false);
+ ret->new_port_view(*p);
ret->set_stacked_border(node->polyphonic());
if (human)
ret->show_human_names(human); // FIXME: double port iteration
- else
- ret->resize();
return ret;
}
@@ -149,8 +147,6 @@ NodeModule::show_human_names(bool b)
}
(*i)->set_name(label);
}
-
- resize();
}
void
@@ -237,8 +233,6 @@ NodeModule::embed_gui(bool embed)
} else {
set_default_base_color();
}
-
- resize();
}
void
@@ -246,12 +240,11 @@ NodeModule::rename()
{
if (App::instance().configuration()->name_style() == Configuration::PATH) {
set_name(_node->path().symbol());
- resize();
}
}
void
-NodeModule::new_port_view(SharedPtr<const PortModel> port, bool resize_to_fit)
+NodeModule::new_port_view(SharedPtr<const PortModel> port)
{
Port::create(*this, port,
App::instance().configuration()->name_style() == Configuration::HUMAN);
@@ -259,9 +252,6 @@ NodeModule::new_port_view(SharedPtr<const PortModel> port, bool resize_to_fit)
port->signal_value_changed().connect(
sigc::bind<0>(sigc::mem_fun(this, &NodeModule::value_changed),
port->index()));
-
- if (resize_to_fit)
- resize();
}
Port*
diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp
index 7bf6f996..db6fb274 100644
--- a/src/gui/NodeModule.hpp
+++ b/src/gui/NodeModule.hpp
@@ -79,7 +79,7 @@ protected:
void rename();
void property_changed(const Raul::URI& predicate, const Raul::Atom& value);
- void new_port_view(SharedPtr<const PortModel> port, bool resize=true);
+ void new_port_view(SharedPtr<const PortModel> port);
void value_changed(uint32_t index, const Raul::Atom& value);
void plugin_changed();
diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp
index df4d8dc8..49dc4925 100644
--- a/src/gui/PatchPortModule.cpp
+++ b/src/gui/PatchPortModule.cpp
@@ -68,7 +68,6 @@ PatchPortModule::create(PatchCanvas& canvas,
m != model->properties().end(); ++m)
ret->property_changed(m->first, m->second);
- ret->resize();
return ret;
}
@@ -110,15 +109,13 @@ PatchPortModule::show_human_names(bool b)
set_name(name.get_string());
else
set_name(_model->symbol().c_str());
-
- resize();
}
void
PatchPortModule::set_name(const std::string& n)
{
_port->set_name(n);
- Module::resize();
+ _must_resize = true;
}
void