summaryrefslogtreecommitdiff
path: root/gtk2_ardour/script_selector.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-03-13 21:25:16 +0100
committerRobin Gareus <robin@gareus.org>2017-03-13 21:25:16 +0100
commitac46fb27000112b03a8bc25648feec5cb16f0711 (patch)
treeb411e4f56250f8b8d9851cb11cedd741c0d938a0 /gtk2_ardour/script_selector.cc
parent9cc068756be4f3e4a6660582bd9233cff5267849 (diff)
Use a label for required script instance parameters
Diffstat (limited to 'gtk2_ardour/script_selector.cc')
-rw-r--r--gtk2_ardour/script_selector.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/gtk2_ardour/script_selector.cc b/gtk2_ardour/script_selector.cc
index a80a0af1cc..c13b122cd1 100644
--- a/gtk2_ardour/script_selector.cc
+++ b/gtk2_ardour/script_selector.cc
@@ -176,17 +176,21 @@ ScriptParameterDialog::ScriptParameterDialog (std::string title,
}
for (size_t i = 0; i < _lsp.size (); ++i) {
- CheckButton* c = manage (new CheckButton (_lsp[i]->title));
Entry* e = manage (new Entry());
- c->set_active (!_lsp[i]->optional); // also if default ??
- c->set_sensitive (_lsp[i]->optional);
- e->set_text (_lsp[i]->dflt);
- e->set_sensitive (c->get_active ());
+ if (_lsp[i]->optional) {
+ CheckButton* c = manage (new CheckButton (_lsp[i]->title));
+ c->set_active (!_lsp[i]->dflt.empty());
+ c->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &ScriptParameterDialog::active_changed), i, c, e));
+ t->attach (*c, 0, 1, ty, ty+1);
+ } else {
+ Label* l = manage (new Label (_lsp[i]->title, Gtk::ALIGN_LEFT));
+ t->attach (*l, 0, 1, ty, ty+1);
+ }
- c->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &ScriptParameterDialog::active_changed), i, c, e));
+ e->set_text (_lsp[i]->dflt);
+ e->set_sensitive (!_lsp[i]->dflt.empty());
e->signal_changed().connect (sigc::bind (sigc::mem_fun (*this, &ScriptParameterDialog::value_changed), i, e));
- t->attach (*c, 0, 1, ty, ty+1);
t->attach (*e, 1, 2, ty, ty+1);
++ty;
}