diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/Controls.cpp | 14 | ||||
-rw-r--r-- | src/gui/Controls.hpp | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/Controls.cpp b/src/gui/Controls.cpp index 0d99b0dc..1a443ec7 100644 --- a/src/gui/Controls.cpp +++ b/src/gui/Controls.cpp @@ -73,6 +73,12 @@ Control::init(ControlPanel* panel, SharedPtr<PortModel> pm) _control_connection.disconnect(); _control_connection = pm->signal_value_changed.connect(sigc::mem_fun(this, &Control::set_value)); + + boost::shared_ptr<NodeModel> parent = PtrCast<NodeModel>(_port_model->parent()); + if (parent) + set_label(parent->port_label(pm)); + else + set_label(pm->symbol().c_str()); } @@ -95,7 +101,7 @@ Control::disable() void -Control::set_name(const string& name) +Control::set_label(const string& name) { const string name_markup = string("<span weight=\"bold\">") + name + "</span>"; _name_label->set_markup(name_markup); @@ -137,8 +143,6 @@ SliderControl::init(ControlPanel* panel, SharedPtr<PortModel> pm) assert(_name_label); assert(_slider); - set_name(pm->path().symbol()); - _slider->set_draw_value(false); signal_button_press_event().connect(sigc::mem_fun(*this, &SliderControl::clicked)); @@ -320,8 +324,6 @@ ToggleControl::init(ControlPanel* panel, SharedPtr<PortModel> pm) assert(_name_label); assert(_checkbutton); - set_name(pm->path().symbol()); - _checkbutton->signal_toggled().connect(sigc::mem_fun(*this, &ToggleControl::toggled)); set_value(pm->value()); @@ -385,8 +387,6 @@ StringControl::init(ControlPanel* panel, SharedPtr<PortModel> pm) assert(_name_label); assert(_entry); - set_name(pm->path().symbol()); - _entry->signal_activate().connect(sigc::mem_fun(*this, &StringControl::activated)); set_value(pm->value()); diff --git a/src/gui/Controls.hpp b/src/gui/Controls.hpp index a26dfd41..1818cc75 100644 --- a/src/gui/Controls.hpp +++ b/src/gui/Controls.hpp @@ -54,7 +54,7 @@ protected: virtual void set_value(const Raul::Atom& value) = 0; virtual void set_range(float min, float max) {} - void set_name(const std::string& name); + void set_label(const std::string& name); void menu_properties(); ControlPanel* _control_panel; |