aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/controls
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-12-13 21:05:29 +0800
committercrupest <crupest@outlook.com>2021-12-13 21:05:29 +0800
commit419a09298abcba851313c2160cc00e24b48850fc (patch)
tree1a48d78a26c7ee3a293c36c959da6ac8cea4db03 /include/cru/ui/controls
parent21fccf43ec049569f690674840ca1a10420a40da (diff)
downloadcru-419a09298abcba851313c2160cc00e24b48850fc.tar.gz
cru-419a09298abcba851313c2160cc00e24b48850fc.tar.bz2
cru-419a09298abcba851313c2160cc00e24b48850fc.zip
...
Diffstat (limited to 'include/cru/ui/controls')
-rw-r--r--include/cru/ui/controls/TextHostControlService.hpp8
1 files changed, 6 insertions, 2 deletions
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<gsl::index(TextHostControlService* service, StringView text,
gsl::index current_position)>;
- 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_;
};