Browse Source

implement custom title setter

CPP-GTK4
yggverse 1 month ago
parent
commit
d88bea1fa6
  1. 6
      src/app/browser/header/main.cpp
  2. 12
      src/app/browser/header/main/title.cpp
  3. 6
      src/app/browser/header/main/title.hpp

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

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

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

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

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

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

Loading…
Cancel
Save