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

@ -96,7 +96,7 @@ public:
void set_stat_label(RefPtr<GUI::Label> l) { stats = l; };
private:
explicit Fire(GUI::Widget* parent = nullptr);
Fire();
RefPtr<Gfx::Bitmap> bitmap;
RefPtr<GUI::Label> stats;
@ -112,8 +112,7 @@ private:
int phase;
};
Fire::Fire(GUI::Widget* parent)
: GUI::Widget(parent)
Fire::Fire()
{
bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::Indexed8, { 320, 200 });
@ -250,7 +249,7 @@ int main(int argc, char** argv)
auto fire = Fire::construct();
window->set_main_widget(fire);
auto time = GUI::Label::construct(fire);
auto time = fire->add<GUI::Label>();
time->set_relative_rect({ 0, 4, 40, 10 });
time->move_by({ window->width() - time->width(), 0 });
time->set_foreground_color(Color::from_rgb(0x444444));