/* * Copyright (c) 2018-2020, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include #include #include #include #include #include namespace GUI { AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Window* parent_window) : Dialog(parent_window) , m_name(name) , m_icon(icon) { resize(413, 205); set_title(String::formatted("About {}", m_name)); set_resizable(false); if (parent_window) set_icon(parent_window->icon()); auto& widget = set_main_widget(); 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"); 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({ 0, 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({ 0, 12, 12, 8 }); auto make_label = [&](const StringView& text, bool bold = false) { auto& label = right_container.add