From f0a28851afb5fdb21431494633c86c01947ed0db Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 12 May 2019 22:03:24 +0200 Subject: Remove tooltip when clicked. --- plugingui/tooltip.cc | 8 ++++++++ plugingui/tooltip.h | 1 + 2 files changed, 9 insertions(+) (limited to 'plugingui') diff --git a/plugingui/tooltip.cc b/plugingui/tooltip.cc index 499ab14..19bc89b 100644 --- a/plugingui/tooltip.cc +++ b/plugingui/tooltip.cc @@ -185,4 +185,12 @@ void Tooltip::show() window()->setMouseFocus(this); } +void Tooltip::buttonEvent(ButtonEvent* buttonEvent) +{ + if(buttonEvent->direction == Direction::down) + { + hide(); + } +} + } // GUI:: diff --git a/plugingui/tooltip.h b/plugingui/tooltip.h index b449512..9d1619d 100644 --- a/plugingui/tooltip.h +++ b/plugingui/tooltip.h @@ -53,6 +53,7 @@ public: virtual void resize(std::size_t height, std::size_t width) override; virtual void mouseLeaveEvent() override; virtual void show() override; + virtual void buttonEvent(ButtonEvent* buttonEvent) override; private: void preprocessText(); -- cgit v1.2.3