diff options
author | Rafał Babiarz <5783815+Sauler@users.noreply.github.com> | 2022-12-10 16:50:47 +0100 |
---|---|---|
committer | Andrew Kaster <andrewdkaster@gmail.com> | 2022-12-31 04:36:22 -0700 |
commit | 3454891d3877c41e3daf6ff4bf29c602643a897c (patch) | |
tree | cbef73fcb753bda20340a4af4c40ba6595b668db /Userland/Applications/Browser/Tab.cpp | |
parent | ebe925b7c0dd72c4ed8955fa9e7f7adf84c0a84f (diff) | |
download | serenity-3454891d3877c41e3daf6ff4bf29c602643a897c.zip |
Browser: Add window to inspect history
Diffstat (limited to 'Userland/Applications/Browser/Tab.cpp')
-rw-r--r-- | Userland/Applications/Browser/Tab.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index d6f32ed3f6..477162a62f 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -14,6 +14,7 @@ #include "BrowserWindow.h" #include "ConsoleWidget.h" #include "DownloadWidget.h" +#include "History/HistoryWidget.h" #include "InspectorWidget.h" #include "StorageWidget.h" #include <AK/StringBuilder.h> @@ -752,6 +753,24 @@ void Tab::show_storage_inspector() window->move_to_front(); } +void Tab::show_history_inspector() +{ + if (!m_history_widget) { + auto history_window = GUI::Window::construct(&window()); + history_window->resize(500, 300); + history_window->set_title("History"); + history_window->set_icon(g_icon_bag.history); + m_history_widget = history_window->set_main_widget<HistoryWidget>(); + } + + m_history_widget->clear_history_entries(); + m_history_widget->set_history_entries(m_history.get_all_history_entries()); + + auto* window = m_history_widget->window(); + window->show(); + window->move_to_front(); +} + void Tab::show_event(GUI::ShowEvent&) { m_web_content_view->set_visible(true); |