mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 12:49:08 +00:00
Userspace: Use Core::Object::add() when building interfaces
This commit is contained in:
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user