From 24ffe358c497c8ece9ceebf5448945435be92159 Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 29 Aug 2024 03:38:49 +0300 Subject: [PATCH] add page number argument --- src/app/browser/main.cpp | 8 ++++++-- src/app/browser/main/tab.cpp | 28 ++++++++++++++++++++++++---- src/app/browser/main/tab.hpp | 9 +++++++-- 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/src/app/browser/main.cpp b/src/app/browser/main.cpp index b5360343..1f7ecad6 100644 --- a/src/app/browser/main.cpp +++ b/src/app/browser/main.cpp @@ -81,12 +81,16 @@ void Main::tab_close_all() void Main::tab_history_back() { - mainTab->history_back(); + mainTab->history_back( + mainTab->get_current_page() + ); }; void Main::tab_history_forward() { - mainTab->history_forward(); + mainTab->history_forward( + mainTab->get_current_page() + ); }; void Main::refresh() diff --git a/src/app/browser/main/tab.cpp b/src/app/browser/main/tab.cpp index 294d346b..f8d35c28 100644 --- a/src/app/browser/main/tab.cpp +++ b/src/app/browser/main/tab.cpp @@ -98,11 +98,31 @@ void Tab::close_all() } } -void Tab::history_back() -{} // @TODO +void Tab::history_back( + const int & PAGE_NUMBER +) { + auto tabPage = get_tabPage( + PAGE_NUMBER + ); -void Tab::history_forward() -{} // @TODO + // @TODO tabPage->back() + + // Refresh children widgets + tabPage->refresh(); +} + +void Tab::history_forward( + const int & PAGE_NUMBER +) { + auto tabPage = get_tabPage( + PAGE_NUMBER + ); + + // @TODO tabPage->forward() + + // Refresh children widgets + tabPage->refresh(); +} void Tab::refresh( const int & PAGE_NUMBER diff --git a/src/app/browser/main/tab.hpp b/src/app/browser/main/tab.hpp index dc92f834..552245b8 100644 --- a/src/app/browser/main/tab.hpp +++ b/src/app/browser/main/tab.hpp @@ -54,8 +54,13 @@ namespace app::browser::main void close_right(); void close_all(); - void history_back(); - void history_forward(); + void history_back( + const int & PAGE_NUMBER + ); + + void history_forward( + const int & PAGE_NUMBER + ); void refresh( const int & PAGE_NUMBER