1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:27:35 +00:00

Browser: Add context menu with history for back/forward button

Right clicking on back or forward will now show a context menu with
URLs to navigate to. Also added an optional argument for the number of
steps in go_back() and go_forward().
This commit is contained in:
Marcus Nilsson 2021-05-24 00:58:00 +02:00 committed by GitHub
parent 0688e02339
commit 6b85c7647c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 20 deletions

View file

@ -46,8 +46,8 @@ public:
void load(const URL&, LoadType = LoadType::Normal);
void reload();
void go_back();
void go_forward();
void go_back(int steps = 1);
void go_forward(int steps = 1);
void did_become_active();
void context_menu_requested(const Gfx::IntPoint& screen_position);
@ -104,7 +104,8 @@ private:
RefPtr<GUI::Menu> m_tab_context_menu;
RefPtr<GUI::Menu> m_page_context_menu;
RefPtr<GUI::Menu> m_go_back_context_menu;
RefPtr<GUI::Menu> m_go_forward_context_menu;
String m_title;
RefPtr<const Gfx::Bitmap> m_icon;