From 1046c926c89dec8219fe7f94a7739b1f8a0e6277 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 23 May 2012 01:47:23 +0000 Subject: Update status bar only for control ports with the pointer over them. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4443 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/Port.cpp | 17 ++++++++++------- src/gui/Port.hpp | 1 + 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index 982e586f..5e847400 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -73,6 +73,7 @@ Port::Port(App& app, , _app(app) , _port_model(pm) , _pressed(false) + , _entered(false) , _flipped(flip) { assert(pm); @@ -151,9 +152,11 @@ Port::on_value_changed(GVariant* value) atom); } - PatchBox* box = get_patch_box(); - if (box) { - box->show_port_status(model().get(), atom); + if (_entered) { + PatchBox* box = get_patch_box(); + if (box) { + box->show_port_status(model().get(), atom); + } } } @@ -199,14 +202,14 @@ Port::on_event(GdkEvent* ev) PatchBox* box = NULL; switch (ev->type) { case GDK_ENTER_NOTIFY: - box = get_patch_box(); - if (box) { + _entered = true; + if ((box = get_patch_box())) { box->object_entered(model().get()); } break; case GDK_LEAVE_NOTIFY: - box = get_patch_box(); - if (box) { + _entered = false; + if ((box = get_patch_box())) { box->object_left(model().get()); } break; diff --git a/src/gui/Port.hpp b/src/gui/Port.hpp index 0e5ad508..66f30f79 100644 --- a/src/gui/Port.hpp +++ b/src/gui/Port.hpp @@ -84,6 +84,7 @@ private: App& _app; WeakPtr _port_model; bool _pressed : 1; + bool _entered : 1; bool _flipped : 1; }; -- cgit v1.2.1