implement custom title setter

This commit is contained in:
yggverse 2024-08-20 16:23:13 +03:00
parent e493009c88
commit d88bea1fa6
3 changed files with 21 additions and 5 deletions

View File

@ -28,9 +28,9 @@ Main::~Main()
} }
void Main::set_title( void Main::set_title(
const Glib::ustring text const Glib::ustring value
) { ) {
title->set_text( title->set(
text value
); );
} }

View File

@ -24,7 +24,17 @@ Title::Title()
WIDTH_CHARS WIDTH_CHARS
); );
// @TODO set_text(
DEFAULT_TEXT
);
} }
Title::~Title() = default; Title::~Title() = default;
void Title::set(
const Glib::ustring value
) {
set_text(
value.empty() ? DEFAULT_TEXT : value + " - " + DEFAULT_TEXT
);
}

View File

@ -12,11 +12,17 @@ namespace app::browser::header::main
{ {
const int WIDTH_CHARS = 5; const int WIDTH_CHARS = 5;
const Glib::ustring DEFAULT_TEXT = "Yoda";
public: public:
Title(); Title();
~Title(); ~Title();
void set(
const Glib::ustring value
);
}; };
} }