mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:57:35 +00:00
Ladybird: Do not enable the reload button if history is empty
Not much of an issue currently, but will be once tabs are used to render plain HTML.
This commit is contained in:
parent
70830b711e
commit
9c4ce1b80b
5 changed files with 19 additions and 0 deletions
|
@ -35,6 +35,8 @@ public:
|
|||
bool can_go_forward(int steps = 1) { return (m_current + steps) < static_cast<int>(m_items.size()); }
|
||||
void clear();
|
||||
|
||||
bool is_empty() const { return m_items.is_empty(); }
|
||||
|
||||
private:
|
||||
Vector<URLTitlePair> m_items;
|
||||
int m_current { -1 };
|
||||
|
|
|
@ -732,6 +732,9 @@ URL Tab::url() const
|
|||
|
||||
void Tab::reload()
|
||||
{
|
||||
if (m_history.is_empty())
|
||||
return;
|
||||
|
||||
load(url());
|
||||
}
|
||||
|
||||
|
@ -762,6 +765,7 @@ void Tab::update_actions()
|
|||
return;
|
||||
window.go_back_action().set_enabled(m_history.can_go_back());
|
||||
window.go_forward_action().set_enabled(m_history.can_go_forward());
|
||||
window.reload_action().set_enabled(!m_history.is_empty());
|
||||
}
|
||||
|
||||
ErrorOr<void> Tab::bookmark_current_url()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue