summaryrefslogtreecommitdiffstats
path: root/src/gui/Port.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/Port.cpp')
-rw-r--r--src/gui/Port.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index 4102a52c..949e459d 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -253,6 +253,30 @@ Port::dash()
return _dash;
}
+void
+Port::set_selected(bool b)
+{
+ if (b != selected()) {
+ FlowCanvas::Port::set_selected(b);
+ SharedPtr<PortModel> pm = _port_model.lock();
+ if (pm && b) {
+ const App& app = App::instance();
+ SharedPtr<NodeModel> node = PtrCast<NodeModel>(pm->parent());
+ PatchWindow* win = app.window_factory()->parent_patch_window(node);
+ if (win) {
+ const std::string& doc = node->plugin_model()->port_documentation(
+ pm->index());
+ if (!doc.empty()) {
+ win->doc_textview()->get_buffer()->set_text(doc);
+ win->doc_textview()->show();
+ } else {
+ win->doc_textview()->hide();
+ }
+ }
+ }
+ }
+}
+
} // namespace GUI
} // namespace Ingen