diff options
Diffstat (limited to 'src/gui/NodeView.cpp')
-rw-r--r-- | src/gui/NodeView.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/gui/NodeView.cpp b/src/gui/NodeView.cpp index bf7c0b6..d388921 100644 --- a/src/gui/NodeView.cpp +++ b/src/gui/NodeView.cpp @@ -47,10 +47,11 @@ NodeView::NodeView(Gtk::Window* window, sigc::mem_fun(this, &NodeView::on_property)); } -void +bool NodeView::on_double_click(GdkEventButton*) { NodePropertiesWindow::present(_window, _node); + return true; } bool @@ -83,6 +84,8 @@ NodeView::on_event(GdkEvent* event) } else { _signal_clicked.emit(&event->button); } + } else if (event->type == GDK_2BUTTON_PRESS) { + return on_double_click(&event->button); } return false; } @@ -103,13 +106,11 @@ midi_note_name(uint8_t num) void NodeView::show_label(bool show) { - if (show) { - if (_enter_action) { - Raul::Atom note_number = _enter_action->get(URIs::instance().machina_note_number); - if (note_number.is_valid()) { - set_label(midi_note_name(note_number.get_int32()).c_str()); - return; - } + if (show && _enter_action) { + Raul::Atom note_number = _enter_action->get(URIs::instance().machina_note_number); + if (note_number.is_valid()) { + set_label(midi_note_name(note_number.get_int32()).c_str()); + return; } } @@ -150,8 +151,13 @@ NodeView::on_property(Machina::URIInt key, const Raul::Atom& value) MachinaCanvas* canvas = dynamic_cast<MachinaCanvas*>(this->canvas()); _enter_action_connection.disconnect(); _enter_action = canvas->app()->client_model()->find(action_id); - _enter_action_connection = _enter_action->signal_property.connect( - sigc::mem_fun(this, &NodeView::on_action_property)); + if (_enter_action) { + _enter_action_connection = _enter_action->signal_property.connect( + sigc::mem_fun(this, &NodeView::on_action_property)); + for (auto i : _enter_action->properties()) { + on_action_property(i.first, i.second); + } + } } else { cout << "Unknown property " << key << endl; } @@ -160,8 +166,9 @@ NodeView::on_property(Machina::URIInt key, const Raul::Atom& value) void NodeView::on_action_property(Machina::URIInt key, const Raul::Atom& value) { - if (key == URIs::instance().machina_note_number) + if (key == URIs::instance().machina_note_number) { show_label(true); + } } void |