hide widget on empty value

This commit is contained in:
yggverse 2024-08-27 14:53:53 +03:00
parent 9be94979b9
commit cc15498f7a
2 changed files with 9 additions and 0 deletions

View File

@ -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();
}

View File

@ -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();
}