1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 18:55:08 +00:00

Userspace: Use Core::Object::add() when building interfaces

This commit is contained in:
Andreas Kling 2020-02-23 10:57:42 +01:00
parent 7ec758773c
commit 3d20da9ee4
87 changed files with 403 additions and 438 deletions

View file

@ -32,8 +32,7 @@
#include <LibGfx/Font.h>
#include <unistd.h>
ProcessStateWidget::ProcessStateWidget(GUI::Widget* parent)
: GUI::Widget(parent)
ProcessStateWidget::ProcessStateWidget()
{
set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
set_preferred_size(0, 20);
@ -41,24 +40,24 @@ ProcessStateWidget::ProcessStateWidget(GUI::Widget* parent)
set_layout(make<GUI::HorizontalBoxLayout>());
auto pid_label_label = GUI::Label::construct("Process:", this);
auto pid_label_label = add<GUI::Label>("Process:");
pid_label_label->set_font(Gfx::Font::default_bold_font());
m_pid_label = GUI::Label::construct("", this);
m_pid_label = add<GUI::Label>("");
auto state_label_label = GUI::Label::construct("State:", this);
auto state_label_label = add<GUI::Label>("State:");
state_label_label->set_font(Gfx::Font::default_bold_font());
m_state_label = GUI::Label::construct("", this);
m_state_label = add<GUI::Label>("");
// FIXME: This should show CPU% instead.
auto cpu_label_label = GUI::Label::construct("Times scheduled:", this);
auto cpu_label_label = add<GUI::Label>("Times scheduled:");
cpu_label_label->set_font(Gfx::Font::default_bold_font());
m_cpu_label = GUI::Label::construct("", this);
m_cpu_label = add<GUI::Label>("");
auto memory_label_label = GUI::Label::construct("Memory (resident):", this);
auto memory_label_label = add<GUI::Label>("Memory (resident):");
memory_label_label->set_font(Gfx::Font::default_bold_font());
m_memory_label = GUI::Label::construct("", this);
m_memory_label = add<GUI::Label>("");
m_timer = Core::Timer::construct(500, [this] {
m_timer = add<Core::Timer>(500, [this] {
refresh();
});
}