update window subtitle on refresh

This commit is contained in:
yggverse 2024-08-27 16:39:44 +03:00
parent fb71cfa2be
commit 61613c12af
5 changed files with 42 additions and 9 deletions

View File

@ -102,7 +102,11 @@ Browser::Browser(
browserMain->refresh();
browserHeader->set_title(
browserMain->get_current_tab_label_text()
browserMain->get_current_tab_page_title()
);
browserHeader->set_subtitle(
browserMain->get_current_tab_page_subtitle()
);
}
);

View File

@ -28,9 +28,16 @@ Main::~Main()
}
// Getters
Glib::ustring Main::get_current_tab_label_text()
Glib::ustring Main::get_current_tab_page_title()
{
return mainTab->get_label_text(
return mainTab->get_page_title(
mainTab->get_current_page()
);
};
Glib::ustring Main::get_current_tab_page_subtitle()
{
return mainTab->get_page_subtitle(
mainTab->get_current_page()
);
};

View File

@ -26,7 +26,8 @@ namespace app::browser
~Main();
// Getters
Glib::ustring get_current_tab_label_text();
Glib::ustring get_current_tab_page_title();
Glib::ustring get_current_tab_page_subtitle();
// Actions
void tab_append();

View File

@ -26,7 +26,7 @@ Tab::Tab()
Tab::~Tab() = default;
// Getters
Glib::ustring Tab::get_label_text(
Glib::ustring Tab::get_page_title(
const int & PAGE_NUMBER
) {
auto pageWidget = get_nth_page(
@ -35,9 +35,26 @@ Glib::ustring Tab::get_label_text(
if (pageWidget != nullptr)
{
return get_tab_label_text(
* pageWidget
);
auto tabPage = (tab::Page *) pageWidget;
return tabPage->get_title();
}
return ""; // @TODO
};
Glib::ustring Tab::get_page_subtitle(
const int & PAGE_NUMBER
) {
auto pageWidget = get_nth_page(
PAGE_NUMBER
);
if (pageWidget != nullptr)
{
auto tabPage = (tab::Page *) pageWidget;
return tabPage->get_subtitle();
}
return ""; // @TODO

View File

@ -18,7 +18,11 @@ namespace app::browser::main
~Tab();
Glib::ustring get_label_text(
Glib::ustring get_page_title(
const int & PAGE_NUMBER
);
Glib::ustring get_page_subtitle(
const int & PAGE_NUMBER
);