apps+libui: Make app.run() call window->draw() automatically
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e18ca9bfe0
commit
7812a4a44a
@ -360,7 +360,5 @@ Result<int> luna_main(int argc, char** argv)
|
||||
window->set_main_widget(game);
|
||||
game.reset();
|
||||
|
||||
window->draw();
|
||||
|
||||
return app.run();
|
||||
}
|
||||
|
@ -42,7 +42,5 @@ Result<int> luna_main(int argc, char** argv)
|
||||
ui::Label kernel_version(kernel_version_text.view());
|
||||
version_info.add_widget(kernel_version);
|
||||
|
||||
window->draw();
|
||||
|
||||
return app.run();
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ Result<int> luna_main(int argc, char** argv)
|
||||
|
||||
auto window = TRY(ui::Window::create(bar, ui::WindowType::System));
|
||||
app.set_main_window(window);
|
||||
|
||||
window->set_background(TASKBAR_COLOR);
|
||||
|
||||
ui::HorizontalLayout layout(ui::Margins { 0, 0, 0, 0 }, ui::AdjustHeight::Yes, ui::AdjustWidth::No);
|
||||
@ -65,7 +66,5 @@ Result<int> luna_main(int argc, char** argv)
|
||||
StringView clock_command[] = { "/usr/bin/clock" };
|
||||
TRY(create_widget_group_for_app(layout, { clock_command, 1 }, "/usr/share/icons/32x32/app-clock.tga"));
|
||||
|
||||
window->draw();
|
||||
|
||||
return app.run();
|
||||
}
|
||||
|
@ -59,6 +59,8 @@ namespace ui
|
||||
|
||||
Result<int> App::run()
|
||||
{
|
||||
TRY(m_main_window->draw());
|
||||
|
||||
return m_loop.run();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user