Browse Source

use custom text setter on widget init

CPP-GTK4
yggverse 3 months ago
parent
commit
e204460e59
  1. 6
      src/app/browser/header/main/title.cpp

6
src/app/browser/header/main/title.cpp

@ -24,11 +24,9 @@ Title::Title()
WIDTH_CHARS WIDTH_CHARS
); );
set_text( set(
DEFAULT_TEXT DEFAULT_TEXT
); );
hide();
} }
Title::~Title() = default; Title::~Title() = default;
@ -37,7 +35,7 @@ void Title::set(
const Glib::ustring & TEXT const Glib::ustring & TEXT
) { ) {
set_text( set_text(
TEXT.empty() ? DEFAULT_TEXT : TEXT + " - " + DEFAULT_TEXT TEXT.empty() || TEXT == DEFAULT_TEXT ? DEFAULT_TEXT : TEXT + " - " + DEFAULT_TEXT
); );
if (get_text().empty()) hide(); else show(); if (get_text().empty()) hide(); else show();

Loading…
Cancel
Save