diff --git a/src/app/browser.cpp b/src/app/browser.cpp index f54c3af8..67eb3aef 100644 --- a/src/app/browser.cpp +++ b/src/app/browser.cpp @@ -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() ); } ); diff --git a/src/app/browser/main.cpp b/src/app/browser/main.cpp index c2ecc8d9..5bdb30bd 100644 --- a/src/app/browser/main.cpp +++ b/src/app/browser/main.cpp @@ -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() ); }; diff --git a/src/app/browser/main.hpp b/src/app/browser/main.hpp index 64838d10..23d04854 100644 --- a/src/app/browser/main.hpp +++ b/src/app/browser/main.hpp @@ -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(); diff --git a/src/app/browser/main/tab.cpp b/src/app/browser/main/tab.cpp index 5a44c9eb..893d26eb 100644 --- a/src/app/browser/main/tab.cpp +++ b/src/app/browser/main/tab.cpp @@ -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 diff --git a/src/app/browser/main/tab.hpp b/src/app/browser/main/tab.hpp index 205b53a0..471f01c2 100644 --- a/src/app/browser/main/tab.hpp +++ b/src/app/browser/main/tab.hpp @@ -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 );