From 57353bd3acd97957cb5f970016fec52977cc6e95 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 2 Mar 2022 22:07:33 +0800 Subject: ... --- include/cru/ui/components/PopupButton.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'include/cru/ui/components') diff --git a/include/cru/ui/components/PopupButton.h b/include/cru/ui/components/PopupButton.h index 37420ff6..c8ef9c50 100644 --- a/include/cru/ui/components/PopupButton.h +++ b/include/cru/ui/components/PopupButton.h @@ -3,6 +3,7 @@ #include "cru/ui/Base.h" #include "cru/ui/components/Menu.h" #include "cru/ui/controls/Button.h" +#include "cru/ui/controls/IconButton.h" #include "cru/ui/controls/Popup.h" #include "cru/ui/controls/TextBlock.h" @@ -35,4 +36,25 @@ class CRU_UI_API PopupMenuTextButton : public Component { Event menu_item_selected_event_; }; + +class CRU_UI_API PopupMenuIconButton : public Component { + public: + PopupMenuIconButton(); + ~PopupMenuIconButton() override; + + public: + ui::controls::Control* GetRootControl() override { return &button_; } + + ui::controls::IconButton* GetButton() { return &button_; } + + void SetMenuItems(std::vector items); + + IEvent* MenuItemSelectedEvent() { return &menu_item_selected_event_; } + + private: + ui::controls::IconButton button_; + PopupMenu popup_menu_; + + Event menu_item_selected_event_; +}; } // namespace cru::ui::components -- cgit v1.2.3