apps+libui: Make app.run() call window->draw() automatically
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-10-10 22:24:11 +02:00
parent e18ca9bfe0
commit 7812a4a44a
Signed by: apio
GPG Key ID: B8A7D06E42258954
4 changed files with 3 additions and 6 deletions

View File

@ -360,7 +360,5 @@ Result<int> luna_main(int argc, char** argv)
window->set_main_widget(game);
game.reset();
window->draw();
return app.run();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -59,6 +59,8 @@ namespace ui
Result<int> App::run()
{
TRY(m_main_window->draw());
return m_loop.run();
}