1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:08:12 +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:
Mahmoud Mandour 2021-08-29 12:00:50 +02:00 committed by Linus Groh
parent 7742f37c10
commit eb6f9d469a
2 changed files with 8 additions and 12 deletions

View file

@ -5,7 +5,6 @@
*/
#include <AK/StringBuilder.h>
#include <LibCore/Version.h>
#include <LibGUI/AboutDialog.h>
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Button.h>
@ -17,10 +16,11 @@
namespace GUI {
AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Window* parent_window)
AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Window* parent_window, const StringView& version)
: Dialog(parent_window)
, m_name(name)
, m_icon(icon)
, m_version_string(version)
{
resize(413, 204);
set_title(String::formatted("About {}", m_name));
@ -70,7 +70,7 @@ AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Window
// If we are displaying a dialog for an application, insert 'SerenityOS' below the application name
if (m_name != "SerenityOS")
make_label("SerenityOS");
make_label(version_string());
make_label(m_version_string);
make_label("Copyright \xC2\xA9 the SerenityOS developers, 2018-2021");
right_container.layout()->add_spacer();
@ -90,9 +90,4 @@ AboutDialog::~AboutDialog()
{
}
String AboutDialog::version_string() const
{
return Core::Version::SERENITY_VERSION;
}
}