From 419a09298abcba851313c2160cc00e24b48850fc Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 13 Dec 2021 21:05:29 +0800 Subject: ... --- include/cru/ui/controls/TextHostControlService.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/cru/ui/controls/TextHostControlService.hpp') diff --git a/include/cru/ui/controls/TextHostControlService.hpp b/include/cru/ui/controls/TextHostControlService.hpp index 1bdf0509..7c0fbcda 100644 --- a/include/cru/ui/controls/TextHostControlService.hpp +++ b/include/cru/ui/controls/TextHostControlService.hpp @@ -51,9 +51,11 @@ class TextControlMovePattern : public Object { std::function; - TextControlMovePattern(helper::ShortcutKeyBind key_bind, + TextControlMovePattern(String name, helper::ShortcutKeyBind key_bind, MoveFunction move_function) - : key_bind_(key_bind), move_function_(move_function) {} + : name_(std::move(name)), + key_bind_(key_bind), + move_function_(move_function) {} CRU_DEFAULT_COPY(TextControlMovePattern) CRU_DEFAULT_MOVE(TextControlMovePattern) @@ -61,6 +63,7 @@ class TextControlMovePattern : public Object { ~TextControlMovePattern() override = default; public: + String GetName() const { return name_; } helper::ShortcutKeyBind GetKeyBind() const { return key_bind_; } gsl::index Move(TextHostControlService* service, StringView text, gsl::index current_position) const { @@ -68,6 +71,7 @@ class TextControlMovePattern : public Object { } private: + String name_; helper::ShortcutKeyBind key_bind_; MoveFunction move_function_; }; -- cgit v1.2.3