1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

Browser: Add window to inspect history

This commit is contained in:
Rafał Babiarz 2022-12-10 16:50:47 +01:00 committed by Andrew Kaster
parent ebe925b7c0
commit 3454891d38
11 changed files with 259 additions and 0 deletions

View file

@ -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);