diff --git a/src/app/browser/main.cpp b/src/app/browser/main.cpp index b66c2b56..c435ae6a 100644 --- a/src/app/browser/main.cpp +++ b/src/app/browser/main.cpp @@ -40,7 +40,9 @@ Glib::ustring Main::get_current_tab_label_text() // Actions void Main::tab_append() { - tab->append(); + tab->append( + _("New page") + ); }; void Main::tab_update() diff --git a/src/app/browser/main.hpp b/src/app/browser/main.hpp index 34fef3c3..4f7e2ed3 100644 --- a/src/app/browser/main.hpp +++ b/src/app/browser/main.hpp @@ -1,6 +1,7 @@ #ifndef APP_BROWSER_MAIN_HPP #define APP_BROWSER_MAIN_HPP +#include #include #include diff --git a/src/app/browser/main/tab.cpp b/src/app/browser/main/tab.cpp index 40f06a76..57338bb1 100644 --- a/src/app/browser/main/tab.cpp +++ b/src/app/browser/main/tab.cpp @@ -49,16 +49,20 @@ Glib::ustring Tab::get_label_text( // Actions void Tab::append( - const Glib::ustring & page_navbar_request_text, - bool focus + const Glib::ustring & TITLE, + const Glib::ustring & REQUEST, + const bool & TAB_FOCUS ) { - auto tabPage = new tab::Page( - page_navbar_request_text + auto tabPage = new tab::Page( + TITLE, + REQUEST ); + auto tabLabel = new tab::Label; + int page_number = append_page( * tabPage, - * new tab::Label + * tabLabel ); set_tab_reorderable( @@ -66,7 +70,7 @@ void Tab::append( REORDERABLE ); - if (focus) + if (TAB_FOCUS) { set_current_page( page_number diff --git a/src/app/browser/main/tab.hpp b/src/app/browser/main/tab.hpp index 44c3d9a2..b3384067 100644 --- a/src/app/browser/main/tab.hpp +++ b/src/app/browser/main/tab.hpp @@ -23,8 +23,9 @@ namespace app::browser::main ); void append( - const Glib::ustring & page_navbar_request_text = "", - bool focus = true + const Glib::ustring & TITLE, + const Glib::ustring & REQUEST = "", + const bool & TAB_FOCUS = true ); void close( diff --git a/src/app/browser/main/tab/page.cpp b/src/app/browser/main/tab/page.cpp index ed5433f3..0201a90e 100644 --- a/src/app/browser/main/tab/page.cpp +++ b/src/app/browser/main/tab/page.cpp @@ -6,8 +6,12 @@ using namespace app::browser::main::tab; Page::Page( - const Glib::ustring & navbar_request_text + const Glib::ustring & TITLE, + const Glib::ustring & REQUEST ) { + // Init extras + title = TITLE; + // Init container set_orientation( Gtk::Orientation::VERTICAL @@ -32,7 +36,7 @@ Page::Page( // Init components pageNavbar = new page::Navbar( - navbar_request_text + REQUEST ); append( @@ -63,8 +67,17 @@ Page::~Page() delete pageProgressbar; } +// Getters +Glib::ustring Page::get_title() +{ + return title; +} + +// Actions void Page::update() { + title = _("Loading.."); + // Reset progress pageProgressbar->set( 0 diff --git a/src/app/browser/main/tab/page.hpp b/src/app/browser/main/tab/page.hpp index 508a871f..3968fd9f 100644 --- a/src/app/browser/main/tab/page.hpp +++ b/src/app/browser/main/tab/page.hpp @@ -27,6 +27,8 @@ namespace app::browser::main::tab { char buffer[0xfffff]; // 1Mb + Glib::ustring title; + Glib::RefPtr GioSocketClient_RefPtr; Glib::RefPtr GioSocketConnection_RefPtr; @@ -37,11 +39,16 @@ namespace app::browser::main::tab public: Page( - const Glib::ustring & navbar_request_text = "" + const Glib::ustring & TITLE, + const Glib::ustring & REQUEST = "" ); ~Page(); + // Getters + Glib::ustring get_title(); + + // Actions void update(); }; }