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:
parent
7ec758773c
commit
3d20da9ee4
87 changed files with 403 additions and 438 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue