AboutDialog.h 1019 B

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