Browse Source

implement custom title setter

CPP-GTK4
yggverse 1 month ago
parent
commit
d88bea1fa6
  1. 6
      src/app/browser/header/main.cpp
  2. 14
      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() @@ -28,9 +28,9 @@ Main::~Main()
}
void Main::set_title(
const Glib::ustring text
const Glib::ustring value
) {
title->set_text(
text
title->set(
value
);
}

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

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

Loading…
Cancel
Save