diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-12-10 11:57:36 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-12-10 11:57:36 +0800 |
| commit | 2b6641279a8d819adbc94e6d79fdc4bfb299b150 (patch) | |
| tree | 4c18cd51c12ee85d3cfaead683b1fa63af9ca218 /include/cru/ui/components/Menu.h | |
| parent | 6b3eda0665fa65f5e86b2dce0b154b61ae6b2a58 (diff) | |
| download | cru-2b6641279a8d819adbc94e6d79fdc4bfb299b150.tar.gz cru-2b6641279a8d819adbc94e6d79fdc4bfb299b150.tar.bz2 cru-2b6641279a8d819adbc94e6d79fdc4bfb299b150.zip | |
Clean codes.
Diffstat (limited to 'include/cru/ui/components/Menu.h')
| -rw-r--r-- | include/cru/ui/components/Menu.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/cru/ui/components/Menu.h b/include/cru/ui/components/Menu.h index aee23894..8c54e29c 100644 --- a/include/cru/ui/components/Menu.h +++ b/include/cru/ui/components/Menu.h @@ -4,6 +4,7 @@ #include "../controls/FlexLayout.h" #include "../controls/TextBlock.h" #include "../controls/Window.h" +#include "../helper/ClickDetector.h" #include "Component.h" #include <functional> @@ -19,18 +20,17 @@ class CRU_UI_API MenuItem : public Component { controls::Control* GetRootControl() override { return &container_; } void SetText(std::string text); - - void SetOnClick(std::function<void()> on_click) { - on_click_ = std::move(on_click); - } + IEvent<const helper::ClickEventArgs&>* ClickEvent(); private: controls::Button container_; controls::TextBlock text_; - std::function<void()> on_click_; }; class CRU_UI_API Menu : public Component { + private: + constexpr static auto kLogTag = "cru::ui::components::Menu"; + public: Menu(); ~Menu(); |
