diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-06 17:27:10 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-06 17:27:10 +0800 |
| commit | 6315e654ce0be2d2cc148e9ff80f611ac1176348 (patch) | |
| tree | 8232fedd7bbe87d635563e743e22781e20f83376 /include/cru/ui/controls | |
| parent | 38b1268028d4d631de15ca85826c241e39c82675 (diff) | |
| download | cru-6315e654ce0be2d2cc148e9ff80f611ac1176348.tar.gz cru-6315e654ce0be2d2cc148e9ff80f611ac1176348.tar.bz2 cru-6315e654ce0be2d2cc148e9ff80f611ac1176348.zip | |
Refactor Event.
Diffstat (limited to 'include/cru/ui/controls')
| -rw-r--r-- | include/cru/ui/controls/Button.h | 2 | ||||
| -rw-r--r-- | include/cru/ui/controls/IconButton.h | 5 | ||||
| -rw-r--r-- | include/cru/ui/controls/RootControl.h | 2 | ||||
| -rw-r--r-- | include/cru/ui/controls/TextHostControlService.h | 4 |
4 files changed, 7 insertions, 6 deletions
diff --git a/include/cru/ui/controls/Button.h b/include/cru/ui/controls/Button.h index 3c01be32..e8fa50f1 100644 --- a/include/cru/ui/controls/Button.h +++ b/include/cru/ui/controls/Button.h @@ -33,7 +33,7 @@ class CRU_UI_API Button : public SingleChildControl<render::BorderRenderObject>, return click_detector_.StateChangeEvent(); } - IEvent<helper::ClickEventArgs>* ClickEvent() { + IEvent<const helper::ClickEventArgs&>* ClickEvent() { return click_detector_.ClickEvent(); } diff --git a/include/cru/ui/controls/IconButton.h b/include/cru/ui/controls/IconButton.h index 9e7572e0..e52d2a26 100644 --- a/include/cru/ui/controls/IconButton.h +++ b/include/cru/ui/controls/IconButton.h @@ -39,7 +39,7 @@ class CRU_UI_API IconButton : public NoChildControl, return click_detector_.StateChangeEvent(); } - IEvent<helper::ClickEventArgs>* ClickEvent() { + IEvent<const helper::ClickEventArgs&>* ClickEvent() { return click_detector_.ClickEvent(); } @@ -87,7 +87,8 @@ class CRU_UI_API IconButton : public NoChildControl, void SetIconWithSvgPathDataString(std::string_view icon_svg_path_data_string, const Rect& view_port); void SetIconWithSvgPathDataStringResourceKey( - std::string_view icon_svg_path_data_string_resource_key, const Rect& view_port); + std::string_view icon_svg_path_data_string_resource_key, + const Rect& view_port); std::shared_ptr<platform::graphics::IBrush> GetContentBrush() const override { return GetIconFillBrush(); diff --git a/include/cru/ui/controls/RootControl.h b/include/cru/ui/controls/RootControl.h index 5fa8090e..e662b655 100644 --- a/include/cru/ui/controls/RootControl.h +++ b/include/cru/ui/controls/RootControl.h @@ -28,7 +28,7 @@ class CRU_UI_API RootControl Control* attached_control_; - EventRevokerListGuard + EventHandlerRevokerListGuard gain_focus_on_create_and_destroy_when_lose_focus_event_guard_; }; } // namespace cru::ui::controls diff --git a/include/cru/ui/controls/TextHostControlService.h b/include/cru/ui/controls/TextHostControlService.h index 529225a7..a9f4f22b 100644 --- a/include/cru/ui/controls/TextHostControlService.h +++ b/include/cru/ui/controls/TextHostControlService.h @@ -187,8 +187,8 @@ class CRU_UI_API TextHostControlService : public Object { Event<std::nullptr_t> text_change_event_; - EventRevokerListGuard event_guard_; - EventRevokerListGuard input_method_context_event_guard_; + EventHandlerRevokerListGuard event_guard_; + EventHandlerRevokerListGuard input_method_context_event_guard_; std::string text_; TextRange selection_; |
