From c1ce0ecd3458e1939b4e6c9947684378078a724f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 18 Jul 2020 17:39:47 +0200 Subject: Always draw tooltips on top of the widget stack. --- src/ui/tooltip.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/ui/tooltip.h') diff --git a/src/ui/tooltip.h b/src/ui/tooltip.h index 0cfa12d..629863a 100644 --- a/src/ui/tooltip.h +++ b/src/ui/tooltip.h @@ -23,23 +23,37 @@ class Tooltip : public Label /** * @brief resize the tooltip - */ + * */ virtual void resize(); /** * @brief show the tooltip - */ + * */ virtual void show(); /** * @brief hide the tooltip - */ + * */ virtual void hide(); + /** + * @brief draw event distributor + * The default draw event distributor is overwritten to do nothing. + * Tooltips are drawn separately because the need to be on top of everything else. + * @see event_draw_global + * */ + virtual void event_draw(); + + /** + * @brief global draw event distributor + * This is called by the user interface to draw the tooltip after everything else. + * */ + static void event_draw_global(); + /** * @brief the tooltip that is currently visible, nullptr if no tooltip is currently shown * - **/ + * */ static inline Tooltip *global() { return tooltip_global; -- cgit v1.2.3