mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +00:00
Help: Follow clicked links
This also adds a toolbar and a menu which allow you to navigate back and forth through history ^)
This commit is contained in:
parent
afdc5688ec
commit
395e4210ef
Notes:
sideshowbarker
2024-07-19 11:50:22 +09:00
Author: https://github.com/bugaevc
Commit: 395e4210ef
Pull-request: https://github.com/SerenityOS/serenity/pull/624
4 changed files with 145 additions and 7 deletions
22
Applications/Help/History.h
Normal file
22
Applications/Help/History.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
|
||||
class History final {
|
||||
public:
|
||||
void push(const StringView& history_item);
|
||||
String current();
|
||||
|
||||
void go_back();
|
||||
void go_forward();
|
||||
|
||||
bool can_go_back() { return m_current_history_item > 0; }
|
||||
bool can_go_forward() { return m_current_history_item + 1 < m_items.size(); }
|
||||
|
||||
void clear();
|
||||
|
||||
private:
|
||||
Vector<String> m_items;
|
||||
int m_current_history_item { -1 };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue