1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:27:45 +00:00

FontEditor: Add action text to Undo and Redo

This commit is contained in:
thankyouverycool 2023-05-16 08:39:02 -04:00 committed by Andreas Kling
parent e6935cbaaf
commit c10b1e3aea
5 changed files with 63 additions and 28 deletions

View file

@ -74,9 +74,10 @@ private:
class SelectionUndoCommand : public GUI::Command {
public:
SelectionUndoCommand(UndoSelection& selection, NonnullRefPtr<UndoSelection> undo_state)
SelectionUndoCommand(UndoSelection& selection, NonnullRefPtr<UndoSelection> undo_state, String action_text)
: m_undo_state(undo_state)
, m_undo_selection(selection)
, m_action_text(move(action_text))
{
}
virtual void undo() override
@ -96,9 +97,11 @@ public:
else
warnln("Restoring state failed");
}
virtual DeprecatedString action_text() const override { return m_action_text.to_deprecated_string(); }
private:
NonnullRefPtr<UndoSelection> m_undo_state;
RefPtr<UndoSelection> m_redo_state;
UndoSelection& m_undo_selection;
String m_action_text;
};