mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:27:34 +00:00
LibGUI: Add a "long text" string to GUI::Action
Actions can now have a longer text description, in addition to its regular UI string. The longer text will soon be used to display a more detailed description of hovered actions in statusbars.
This commit is contained in:
parent
ba7e1ca2fb
commit
e7263a7e75
2 changed files with 15 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -87,6 +87,10 @@ public:
|
|||
|
||||
String text() const { return m_text; }
|
||||
void set_text(String text) { m_text = move(text); }
|
||||
|
||||
String const& long_text() const { return m_long_text; }
|
||||
void set_long_text(String long_text) { m_long_text = move(long_text); }
|
||||
|
||||
Shortcut shortcut() const { return m_shortcut; }
|
||||
const Gfx::Bitmap* icon() const { return m_icon.ptr(); }
|
||||
void set_icon(const Gfx::Bitmap*);
|
||||
|
@ -134,6 +138,7 @@ private:
|
|||
void for_each_menu_item(Callback);
|
||||
|
||||
String m_text;
|
||||
String m_long_text;
|
||||
RefPtr<Gfx::Bitmap> m_icon;
|
||||
Shortcut m_shortcut;
|
||||
bool m_enabled { true };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue