mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:37:45 +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
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