1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:07:35 +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

@ -223,7 +223,7 @@ int main(int argc, char** argv)
auto* fire = new Fire;
window->set_main_widget(fire);
auto* time = new GLabel(fire);
auto time = GLabel::construct(fire);
time->set_relative_rect({ 0, 4, 40, 10 });
time->move_by({ window->width() - time->width(), 0 });
time->set_foreground_color(Color::from_rgb(0x444444));

View file

@ -20,7 +20,7 @@ int main(int argc, char** argv)
main_widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
main_widget->layout()->set_margins({ 4, 4, 4, 4 });
auto* label = new GLabel(main_widget);
auto label = GLabel::construct(main_widget);
label->set_text("Hello\nWorld!");
auto* button = new GButton(main_widget);

View file

@ -50,9 +50,9 @@ int main(int argc, char** argv)
progress1->set_value(progress1->min());
});
auto* label1 = new GLabel("GLabel 1", main_widget);
auto label1 = GLabel::construct("GLabel 1", main_widget);
(void)label1;
auto* label2 = new GLabel("GLabel 2", main_widget);
auto label2 = GLabel::construct("GLabel 2", main_widget);
label2->set_enabled(false);
auto* textbox1 = new GTextBox(main_widget);