mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 20:16:02 +00:00
AboutDialog: Accept a version string
This allows applications to specify a version string to appear in the `AboutDialog`.
This commit is contained in:
parent
7742f37c10
commit
eb6f9d469a
Notes:
sideshowbarker
2024-07-18 04:54:23 +09:00
Author: https://github.com/i3abghany
Commit: eb6f9d469a
Pull-request: https://github.com/SerenityOS/serenity/pull/9661
Reviewed-by: https://github.com/nico ✅
Reviewed-by: https://github.com/sppmacd
2 changed files with 8 additions and 12 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibCore/Version.h>
|
||||
#include <LibGUI/Dialog.h>
|
||||
|
||||
namespace GUI {
|
||||
|
@ -15,19 +16,19 @@ class AboutDialog final : public Dialog {
|
|||
public:
|
||||
virtual ~AboutDialog() override;
|
||||
|
||||
static void show(const StringView& name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr, const Gfx::Bitmap* window_icon = nullptr)
|
||||
static void show(const StringView& name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr, const Gfx::Bitmap* window_icon = nullptr, const StringView& version = Core::Version::SERENITY_VERSION)
|
||||
{
|
||||
auto dialog = AboutDialog::construct(name, icon, parent_window);
|
||||
auto dialog = AboutDialog::construct(name, icon, parent_window, version);
|
||||
if (window_icon)
|
||||
dialog->set_icon(window_icon);
|
||||
dialog->exec();
|
||||
}
|
||||
|
||||
private:
|
||||
AboutDialog(const StringView& name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr);
|
||||
String version_string() const;
|
||||
AboutDialog(const StringView& name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr, const StringView& version = Core::Version::SERENITY_VERSION);
|
||||
|
||||
String m_name;
|
||||
RefPtr<Gfx::Bitmap> m_icon;
|
||||
String m_version_string;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue