/* * Copyright (c) 2018-2020, Andreas Kling * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include #include #include #include #include namespace GUI { AboutDialog::AboutDialog(StringView name, StringView version, Gfx::Bitmap const* icon, Window* parent_window) : Dialog(parent_window) , m_name(name) , m_icon(icon) , m_version_string(version) { resize(413, 204); set_title(DeprecatedString::formatted("About {}", m_name)); set_resizable(false); if (parent_window) set_icon(parent_window->icon()); auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); widget->set_fill_with_background_color(true); widget->set_layout(); widget->layout()->set_spacing(0); auto& banner_image = widget->add(); banner_image.load_from_file("/res/graphics/brand-banner.png"sv); auto& content_container = widget->add(); content_container.set_layout(); auto& left_container = content_container.add(); left_container.set_fixed_width(60); left_container.set_layout(); left_container.layout()->set_margins({ 12, 0, 0 }); if (icon) { auto& icon_wrapper = left_container.add(); icon_wrapper.set_fixed_size(32, 48); icon_wrapper.set_layout(); auto& icon_image = icon_wrapper.add(); icon_image.set_bitmap(m_icon); } auto& right_container = content_container.add(); right_container.set_layout(); right_container.layout()->set_margins({ 12, 4, 4, 0 }); auto make_label = [&](StringView text, bool bold = false) { auto& label = right_container.add