aboutsummaryrefslogtreecommitdiff
path: root/src/ui/style/Condition.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-12-03 22:44:57 +0800
committercrupest <crupest@outlook.com>2020-12-03 22:44:57 +0800
commitb29fb11be2f043a3438a50d8942b4ad7d2af0034 (patch)
tree5847f7b880b43f2596bc10b46fc52c6f028a7a58 /src/ui/style/Condition.cpp
parent93a8bf8b967817031cd2798cdaedfa73f867dead (diff)
downloadcru-b29fb11be2f043a3438a50d8942b4ad7d2af0034.tar.gz
cru-b29fb11be2f043a3438a50d8942b4ad7d2af0034.tar.bz2
cru-b29fb11be2f043a3438a50d8942b4ad7d2af0034.zip
...
Diffstat (limited to 'src/ui/style/Condition.cpp')
-rw-r--r--src/ui/style/Condition.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ui/style/Condition.cpp b/src/ui/style/Condition.cpp
index 891eb062..f4866c04 100644
--- a/src/ui/style/Condition.cpp
+++ b/src/ui/style/Condition.cpp
@@ -51,6 +51,16 @@ bool FocusCondition::Judge(controls::Control* control) const {
return control->HasFocus() == has_focus_;
}
+std::vector<IBaseEvent*> HoverCondition::ChangeOn(
+ controls::Control* control) const {
+ return {control->MouseEnterEvent()->Direct(),
+ control->MouseLeaveEvent()->Direct()};
+}
+
+bool HoverCondition::Judge(controls::Control* control) const {
+ return control->IsMouseOver() == hover_;
+}
+
ClickStateCondition::ClickStateCondition(helper::ClickState click_state)
: click_state_(click_state) {}