1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 17:55:06 +00:00

LibGUI: Convert GLabel to ObjectPtr

This commit is contained in:
Andreas Kling 2019-09-21 14:19:05 +02:00
parent 6b347747f2
commit c7437f9caa
22 changed files with 47 additions and 45 deletions

View file

@ -22,15 +22,15 @@ MemoryStatsWidget::MemoryStatsWidget(GraphWidget& graph, GWidget* parent)
layout()->set_margins({ 0, 8, 0, 0 });
layout()->set_spacing(3);
auto build_widgets_for_label = [this](const String& description) -> GLabel* {
auto build_widgets_for_label = [this](const String& description) -> ObjectPtr<GLabel> {
auto* container = new GWidget(this);
container->set_layout(make<GBoxLayout>(Orientation::Horizontal));
container->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
container->set_preferred_size(275, 12);
auto* description_label = new GLabel(description, container);
auto description_label = GLabel::construct(description, container);
description_label->set_font(Font::default_bold_font());
description_label->set_text_alignment(TextAlignment::CenterLeft);
auto* label = new GLabel(container);
auto label = GLabel::construct(container);
label->set_text_alignment(TextAlignment::CenterRight);
return label;
};