mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
Everywhere: Move the Ladybird folder to UI
This commit is contained in:
parent
93712b24bf
commit
db47cc41f8
Notes:
github-actions[bot]
2024-11-10 11:51:45 +00:00
Author: https://github.com/trflynn89
Commit: db47cc41f8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
203 changed files with 266 additions and 244 deletions
49
UI/Qt/TaskManagerWindow.cpp
Normal file
49
UI/Qt/TaskManagerWindow.cpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWebView/Application.h>
|
||||
#include <UI/Qt/TaskManagerWindow.h>
|
||||
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace Ladybird {
|
||||
|
||||
TaskManagerWindow::TaskManagerWindow(QWidget* parent)
|
||||
: QWidget(parent, Qt::WindowFlags(Qt::WindowType::Window))
|
||||
, m_web_view(new WebContentView(this))
|
||||
{
|
||||
setLayout(new QVBoxLayout);
|
||||
layout()->addWidget(m_web_view);
|
||||
|
||||
setWindowTitle("Task Manager");
|
||||
resize(600, 400);
|
||||
|
||||
m_update_timer.setInterval(1000);
|
||||
|
||||
QObject::connect(&m_update_timer, &QTimer::timeout, [this] {
|
||||
this->update_statistics();
|
||||
});
|
||||
|
||||
update_statistics();
|
||||
}
|
||||
|
||||
void TaskManagerWindow::showEvent(QShowEvent*)
|
||||
{
|
||||
m_update_timer.start();
|
||||
}
|
||||
|
||||
void TaskManagerWindow::hideEvent(QHideEvent*)
|
||||
{
|
||||
m_update_timer.stop();
|
||||
}
|
||||
|
||||
void TaskManagerWindow::update_statistics()
|
||||
{
|
||||
WebView::Application::the().update_process_statistics();
|
||||
m_web_view->load_html(WebView::Application::the().generate_process_statistics_html());
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue