LibGUI: Make Command::action_text() virtual
It will be easier for some commands to generate an action text on the fly instead of having to think of it up front, so a virtual that you can override seems more convenient here.
This commit is contained in:
parent
bfd2ec88f4
commit
0bfbee4596
Notes:
sideshowbarker
2024-07-18 18:28:44 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0bfbee4596b
1 changed files with 1 additions and 6 deletions
|
@ -17,16 +17,11 @@ public:
|
|||
virtual void undo() { }
|
||||
virtual void redo() { }
|
||||
|
||||
String action_text() const { return m_action_text; }
|
||||
|
||||
virtual String action_text() const { return {}; }
|
||||
virtual bool merge_with(Command const&) { return false; }
|
||||
|
||||
protected:
|
||||
Command() { }
|
||||
void set_action_text(const String& text) { m_action_text = text; }
|
||||
|
||||
private:
|
||||
String m_action_text;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue