1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:57: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

@ -17,13 +17,14 @@ public:
void push(const URL&);
URL current() const;
const Vector<URL> get_back_history();
const Vector<URL> get_forward_history();
void go_back();
void go_forward();
bool can_go_back() { return m_current > 0; }
bool can_go_forward() { return m_current + 1 < static_cast<int>(m_items.size()); }
void go_back(int steps = 1);
void go_forward(int steps = 1);
bool can_go_back(int steps = 1) { return (m_current - steps) >= 0; }
bool can_go_forward(int steps = 1) { return (m_current + steps) < static_cast<int>(m_items.size()); }
void clear();
private: