aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/helper
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-12-01 23:20:01 +0800
committercrupest <crupest@outlook.com>2020-12-01 23:20:01 +0800
commit0fb7a0e0b2b9e04ca414b1e47c69cc854c79831b (patch)
tree46d7f93e96bca49b0ec114c5595567b9bbcec6e3 /include/cru/ui/helper
parent4fcf336d15fe246259ee18ccc99808d80e69c455 (diff)
downloadcru-0fb7a0e0b2b9e04ca414b1e47c69cc854c79831b.tar.gz
cru-0fb7a0e0b2b9e04ca414b1e47c69cc854c79831b.tar.bz2
cru-0fb7a0e0b2b9e04ca414b1e47c69cc854c79831b.zip
...
Diffstat (limited to 'include/cru/ui/helper')
-rw-r--r--include/cru/ui/helper/Styler.hpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/include/cru/ui/helper/Styler.hpp b/include/cru/ui/helper/Styler.hpp
deleted file mode 100644
index ed8bfbdc..00000000
--- a/include/cru/ui/helper/Styler.hpp
+++ /dev/null
@@ -1,47 +0,0 @@
-#pragma once
-#include "cru/common/Base.hpp"
-#include "cru/common/Event.hpp"
-#include "cru/ui/Base.hpp"
-#include "cru/ui/helper/ClickDetector.hpp"
-#include "gsl/pointers"
-
-#include <memory>
-
-namespace cru::ui::helper {
-struct ControlStyleState {
- ClickState click_state;
- bool focus;
-};
-
-class Styler : public Object {
- public:
- // You could provide your click detector. Otherwise a new one will be created.
- explicit Styler(gsl::not_null<controls::Control*> control,
- ClickDetector* click_detector = nullptr);
-
- CRU_DELETE_COPY(Styler)
- CRU_DELETE_MOVE(Styler)
-
- ~Styler();
-
- public:
- gsl::not_null<controls::Control*> GetControl() const { return control_; }
- gsl::not_null<ClickDetector*> GetClickDetector() const {
- return click_detector_;
- }
-
- IEvent<ControlStyleState>* StateChangeEvent() { return &state_change_event_; }
-
- private:
- void RaiseStateChangeEvent();
-
- private:
- gsl::not_null<controls::Control*> control_;
- std::unique_ptr<ClickDetector> managed_click_detector_;
- gsl::not_null<ClickDetector*> click_detector_;
-
- Event<ControlStyleState> state_change_event_;
-
- EventRevokerListGuard event_guard_;
-};
-} // namespace cru::ui::helper