AboutDialog.h 833 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibGUI/Dialog.h>
  8. namespace GUI {
  9. class AboutDialog final : public Dialog {
  10. C_OBJECT(AboutDialog)
  11. public:
  12. virtual ~AboutDialog() override;
  13. static void show(const StringView& name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr, const Gfx::Bitmap* window_icon = nullptr)
  14. {
  15. auto dialog = AboutDialog::construct(name, icon, parent_window);
  16. if (window_icon)
  17. dialog->set_icon(window_icon);
  18. dialog->exec();
  19. }
  20. private:
  21. AboutDialog(const StringView& name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr);
  22. String version_string() const;
  23. String m_name;
  24. RefPtr<Gfx::Bitmap> m_icon;
  25. };
  26. }