summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/GraphBox.cpp5
-rw-r--r--src/gui/GraphView.cpp36
-rw-r--r--src/gui/GraphView.hpp8
-rw-r--r--src/gui/NodeModule.cpp13
-rw-r--r--src/gui/Port.cpp9
5 files changed, 19 insertions, 52 deletions
diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp
index c280ba64..596854e9 100644
--- a/src/gui/GraphBox.cpp
+++ b/src/gui/GraphBox.cpp
@@ -276,11 +276,6 @@ GraphBox::set_graph(SPtr<const GraphModel> graph,
show();
_alignment->show_all();
- _view->signal_object_entered.connect(
- sigc::mem_fun(this, &GraphBox::object_entered));
- _view->signal_object_left.connect(
- sigc::mem_fun(this, &GraphBox::object_left));
-
_menu_human_names->set_active(
_app->world()->conf().option("human-names").get_bool());
_menu_show_port_names->set_active(
diff --git a/src/gui/GraphView.cpp b/src/gui/GraphView.cpp
index 8452e9cf..54e42372 100644
--- a/src/gui/GraphView.cpp
+++ b/src/gui/GraphView.cpp
@@ -105,14 +105,6 @@ GraphView::set_graph(SPtr<const GraphModel> graph)
_poly_spin->signal_value_changed().connect(
sigc::mem_fun(*this, &GraphView::poly_changed));
- #if 0
- _canvas->signal_item_entered.connect(
- sigc::mem_fun(*this, &GraphView::canvas_item_entered));
-
- _canvas->signal_item_left.connect(
- sigc::mem_fun(*this, &GraphView::canvas_item_left));
- #endif
-
_canvas->widget().grab_focus();
}
@@ -127,34 +119,6 @@ GraphView::create(App& app, SPtr<const GraphModel> graph)
return SPtr<GraphView>(result);
}
-#if 0
-void
-GraphView::canvas_item_entered(Gnome::Canvas::Item* item)
-{
- NodeModule* m = dynamic_cast<NodeModule*>(item);
- if (m)
- signal_object_entered.emit(m->block().get());
-
- const Port* p = dynamic_cast<const Port*>(item);
- if (p)
- signal_object_entered.emit(p->model().get());
-}
-
-void
-GraphView::canvas_item_left(Gnome::Canvas::Item* item)
-{
- NodeModule* m = dynamic_cast<NodeModule*>(item);
- if (m) {
- signal_object_left.emit(m->block().get());
- return;
- }
-
- const Port* p = dynamic_cast<const Port*>(item);
- if (p)
- signal_object_left.emit(p->model().get());
-}
-#endif
-
void
GraphView::process_toggled()
{
diff --git a/src/gui/GraphView.hpp b/src/gui/GraphView.hpp
index c060d02e..d571b3b3 100644
--- a/src/gui/GraphView.hpp
+++ b/src/gui/GraphView.hpp
@@ -68,9 +68,6 @@ public:
static SPtr<GraphView> create(App& app,
SPtr<const Client::GraphModel> graph);
- sigc::signal<void, const Client::ObjectModel*> signal_object_entered;
- sigc::signal<void, const Client::ObjectModel*> signal_object_left;
-
private:
void set_graph(SPtr<const Client::GraphModel> graph);
@@ -79,11 +76,6 @@ private:
void clear_clicked();
void refresh_clicked();
- #if 0
- void canvas_item_entered(Gnome::Canvas::Item* item);
- void canvas_item_left(Gnome::Canvas::Item* item);
- #endif
-
void property_changed(const Raul::URI& predicate, const Raul::Atom& value);
void zoom_full();
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index bbafa44f..51cbf038 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -366,7 +366,20 @@ NodeModule::on_event(GdkEvent* ev)
return show_menu(&ev->button);
} else if (ev->type == GDK_2BUTTON_PRESS) {
return on_double_click(&ev->button);
+ } else if (ev->type == GDK_ENTER_NOTIFY) {
+ GraphBox* const box = app().window_factory()->graph_box(
+ dynamic_ptr_cast<const GraphModel>(_block->parent()));
+ if (box) {
+ box->object_entered(_block.get());
+ }
+ } else if (ev->type == GDK_LEAVE_NOTIFY) {
+ GraphBox* const box = app().window_factory()->graph_box(
+ dynamic_ptr_cast<const GraphModel>(_block->parent()));
+ if (box) {
+ box->object_left(_block.get());
+ }
}
+
return false;
}
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index b22339a0..5d8419ee 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -103,6 +103,9 @@ Port::Port(App& app,
signal_value_changed.connect(
sigc::mem_fun(this, &Port::on_value_changed));
+ signal_event().connect(
+ sigc::mem_fun(this, &Port::on_event));
+
update_metadata();
value_changed(pm->value());
}
@@ -274,13 +277,13 @@ Port::on_event(GdkEvent* ev)
if ((box = get_graph_box())) {
box->object_entered(model().get());
}
- break;
+ return true;
case GDK_LEAVE_NOTIFY:
_entered = false;
if ((box = get_graph_box())) {
box->object_left(model().get());
}
- break;
+ return true;
case GDK_BUTTON_PRESS:
if (ev->button.button == 1) {
if (model()->is_enumeration()) {
@@ -307,7 +310,7 @@ Port::on_event(GdkEvent* ev)
break;
}
- return Ganv::Port::on_event(ev);
+ return false;
}
/* Peak colour stuff */