summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/TextDocument.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-08 21:44:22 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-08 22:17:51 +0200
commitce90d87eb60cbb86d07afb101d2226991924b865 (patch)
treebcfc3228aadd9a11242660f635bd4d41854eb284 /Userland/Libraries/LibGUI/TextDocument.cpp
parentc670d8c56d14c48e5641819458695c607531501c (diff)
downloadserenity-ce90d87eb60cbb86d07afb101d2226991924b865.zip
LibGUI: Show command name in GUI::TextEditor undo/redo action text
We can now show things like "Undo Insert Text" and "Redo Remove Text" instead of just "Undo" and "Redo" in menu items. Pretty neat! :^)
Diffstat (limited to 'Userland/Libraries/LibGUI/TextDocument.cpp')
-rw-r--r--Userland/Libraries/LibGUI/TextDocument.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/TextDocument.cpp b/Userland/Libraries/LibGUI/TextDocument.cpp
index 6687574513..e5a91258f5 100644
--- a/Userland/Libraries/LibGUI/TextDocument.cpp
+++ b/Userland/Libraries/LibGUI/TextDocument.cpp
@@ -719,6 +719,11 @@ InsertTextCommand::InsertTextCommand(TextDocument& document, const String& text,
{
}
+String InsertTextCommand::action_text() const
+{
+ return "Insert Text";
+}
+
bool InsertTextCommand::merge_with(GUI::Command const& other)
{
if (!is<InsertTextCommand>(other))
@@ -804,6 +809,11 @@ RemoveTextCommand::RemoveTextCommand(TextDocument& document, const String& text,
{
}
+String RemoveTextCommand::action_text() const
+{
+ return "Remove Text";
+}
+
bool RemoveTextCommand::merge_with(GUI::Command const& other)
{
if (!is<RemoveTextCommand>(other))