Browse Source

rename update action method

CPP-GTK4
yggverse 2 months ago
parent
commit
c3df2818c6
  1. 2
      src/app/browser.cpp
  2. 4
      src/app/browser/main.cpp
  3. 19
      src/app/browser/main.hpp
  4. 40
      src/app/browser/main/tab.cpp
  5. 14
      src/app/browser/main/tab.hpp
  6. 4
      src/app/browser/main/tab/page.cpp
  7. 2
      src/app/browser/main/tab/page.hpp

2
src/app/browser.cpp

@ -106,7 +106,7 @@ Browser::Browser(
"main_tab_page_navigation_update", "main_tab_page_navigation_update",
[this] [this]
{ {
browserMain->tab_page_update(); browserMain->tab_page_navigation_update();
} }
); );

4
src/app/browser/main.cpp

@ -74,9 +74,9 @@ void Main::tab_close_all()
mainTab->close_all(); mainTab->close_all();
}; };
void Main::tab_page_update() void Main::tab_page_navigation_update()
{ {
mainTab->page_update( mainTab->page_navigation_update(
mainTab->get_current_page() mainTab->get_current_page()
); );
}; };

19
src/app/browser/main.hpp

@ -30,18 +30,19 @@ namespace app::browser
Glib::ustring get_current_tab_page_subtitle(); Glib::ustring get_current_tab_page_subtitle();
// Actions // Actions
void tab_append(); void refresh();
void tab_close_all();
void tab_close_left();
void tab_close_right();
void tab_close();
void tab_page_update(); void tab_append();
void tab_close_all();
void tab_close_left();
void tab_close_right();
void tab_close();
void tab_page_navigation_update();
bool tab_page_navigation_history_try_back();
bool tab_page_navigation_history_try_forward();
bool tab_page_navigation_history_try_back();
bool tab_page_navigation_history_try_forward();
void refresh();
}; };
} }

40
src/app/browser/main/tab.cpp

@ -37,6 +37,18 @@ Glib::ustring Tab::get_page_subtitle(
}; };
// Actions // Actions
void Tab::refresh(
const int & PAGE_NUMBER
) {
auto tabPage = get_tabPage(
PAGE_NUMBER
);
get_tabLabel(PAGE_NUMBER)->set_label(
tabPage->get_title()
);
}
void Tab::append( void Tab::append(
const Glib::ustring & TITLE, const Glib::ustring & TITLE,
const Glib::ustring & REQUEST, const Glib::ustring & REQUEST,
@ -96,40 +108,28 @@ void Tab::close_all()
} }
} }
bool Tab::page_navigation_history_try_back( void Tab::page_navigation_update(
const int & PAGE_NUMBER const int & PAGE_NUMBER
) { ) {
return get_tabPage( get_tabPage(
PAGE_NUMBER PAGE_NUMBER
)->navigation_history_try_back(); )->navigation_update();
} }
bool Tab::page_navigation_history_try_forward( bool Tab::page_navigation_history_try_back(
const int & PAGE_NUMBER const int & PAGE_NUMBER
) { ) {
return get_tabPage( return get_tabPage(
PAGE_NUMBER PAGE_NUMBER
)->navigation_history_try_forward(); )->navigation_history_try_back();
}
void Tab::refresh(
const int & PAGE_NUMBER
) {
auto tabPage = get_tabPage(
PAGE_NUMBER
);
get_tabLabel(PAGE_NUMBER)->set_label(
tabPage->get_title()
);
} }
void Tab::page_update( bool Tab::page_navigation_history_try_forward(
const int & PAGE_NUMBER const int & PAGE_NUMBER
) { ) {
get_tabPage( return get_tabPage(
PAGE_NUMBER PAGE_NUMBER
)->update(); )->navigation_history_try_forward();
} }
// Private helpers // Private helpers

14
src/app/browser/main/tab.hpp

@ -58,17 +58,17 @@ namespace app::browser::main
void close_right(); void close_right();
void close_all(); void close_all();
void page_update( void page_navigation_update(
const int & PAGE_NUMBER const int & PAGE_NUMBER
); );
bool page_navigation_history_try_back( bool page_navigation_history_try_back(
const int & PAGE_NUMBER const int & PAGE_NUMBER
); );
bool page_navigation_history_try_forward( bool page_navigation_history_try_forward(
const int & PAGE_NUMBER const int & PAGE_NUMBER
); );
}; };
} }

4
src/app/browser/main/tab/page.cpp

@ -84,7 +84,7 @@ void Page::refresh(
); );
} }
void Page::update( void Page::navigation_update(
const bool & HISTORY const bool & HISTORY
) { ) {
// Update navigation history // Update navigation history
@ -244,7 +244,7 @@ void Page::update(
"gemini://" + pageNavigation->get_request_text() "gemini://" + pageNavigation->get_request_text()
); );
update(); navigation_update();
} }
else else

2
src/app/browser/main/tab/page.hpp

@ -62,7 +62,7 @@ namespace app::browser::main::tab
const double & PROGRESS const double & PROGRESS
); );
void update( void navigation_update(
const bool & HISTORY = false const bool & HISTORY = false
); );
}; };

Loading…
Cancel
Save