From cc15498f7a498d711a8d74e1236c703bc3433bdd Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 27 Aug 2024 14:53:53 +0300 Subject: [PATCH] hide widget on empty value --- src/app/browser/header/main/subtitle.cpp | 5 +++++ src/app/browser/header/main/title.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/app/browser/header/main/subtitle.cpp b/src/app/browser/header/main/subtitle.cpp index f5f2ff6f..0930a19e 100644 --- a/src/app/browser/header/main/subtitle.cpp +++ b/src/app/browser/header/main/subtitle.cpp @@ -23,6 +23,8 @@ Subtitle::Subtitle() set_width_chars( WIDTH_CHARS ); + + hide(); } Subtitle::~Subtitle() = default; @@ -30,7 +32,10 @@ Subtitle::~Subtitle() = default; void Subtitle::set( const Glib::ustring & TEXT ) { + set_text( TEXT ); + + if (get_text().empty()) hide(); else show(); } \ No newline at end of file diff --git a/src/app/browser/header/main/title.cpp b/src/app/browser/header/main/title.cpp index 064b55c9..02e202f9 100644 --- a/src/app/browser/header/main/title.cpp +++ b/src/app/browser/header/main/title.cpp @@ -27,6 +27,8 @@ Title::Title() set_text( DEFAULT_TEXT ); + + hide(); } Title::~Title() = default; @@ -37,4 +39,6 @@ void Title::set( set_text( TEXT.empty() ? DEFAULT_TEXT : TEXT + " - " + DEFAULT_TEXT ); + + if (get_text().empty()) hide(); else show(); } \ No newline at end of file