From 900ff362275c7fc4ef954ecd277608f764abcb11 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 17 Sep 2024 20:59:57 +0300 Subject: [PATCH] update tooltip ui responsibility --- src/app/browser/main/tab/label.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/app/browser/main/tab/label.cpp b/src/app/browser/main/tab/label.cpp index c38e4fc5..02823eac 100644 --- a/src/app/browser/main/tab/label.cpp +++ b/src/app/browser/main/tab/label.cpp @@ -148,10 +148,30 @@ void Label::update( void Label::update( const Glib::ustring & TITLE ) { - set_tooltip_text( - TITLE - ); + // Update tooltip + const auto PARENT = get_parent(); // Parent GtkNotebook widget contain default CSS paddings, + // update tooltip text at one level up instead of this widget, for better UI responsibility on mouse hover. + // @TODO solution does not follow common encapsulation principles, alternative implementation wanted! + if (PARENT != NULL) + { + set_tooltip_text( + Glib::ustring() + ); + + PARENT->set_tooltip_text( + TITLE + ); + } + + else + { + set_tooltip_text( + TITLE + ); + } + + // Update children components labelTitle->update( TITLE );