summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2019-05-12 22:03:24 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2019-05-12 22:03:24 +0200
commitf0a28851afb5fdb21431494633c86c01947ed0db (patch)
treec37818f81920e8555137550f9b16bcd16d2451a5 /plugingui
parent590f3727e594bccbd486cd6742d239c923f9f4db (diff)
Remove tooltip when clicked.
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/tooltip.cc8
-rw-r--r--plugingui/tooltip.h1
2 files changed, 9 insertions, 0 deletions
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();