#include #include #include #include #include #include static constexpr ui::Color BACKGROUND_COLOR = ui::Color::from_rgb(89, 89, 89); Result luna_main(int, char**) { ui::App app; TRY(app.init()); auto* window = TRY(ui::Window::create(ui::Rect { 300, 300, 400, 300 })); app.set_main_window(window); window->set_title("About"); window->set_background(BACKGROUND_COLOR); utsname info; uname(&info); auto* main_layout = TRY(window->create_main_widget()); main_layout->set_layout_settings(ui::Margins { 0, 0, 20, 40 }); auto* title = TRY(main_layout->add_child_widget()); title->set_text("About Luna"); title->set_font(ui::Font::default_bold_font()); auto* version_info = TRY(main_layout->add_child_widget()); version_info->set_layout_settings(ui::Margins { 0, 0, 10, 10 }); auto* os_release = TRY(version_info->add_child_widget()); String os_release_text = TRY(String::format("OS release: %s"_sv, info.release)); os_release->set_text(os_release_text.view()); auto* kernel_version = TRY(version_info->add_child_widget()); String kernel_version_text = TRY(String::format("Kernel version: %s"_sv, info.version)); kernel_version->set_text(kernel_version_text.view()); auto* license = TRY(version_info->add_child_widget()); license->set_text("Licensed under the BSD-2-Clause license."); return app.run(); }