aboutsummaryrefslogtreecommitdiff
path: root/src/ui/ui_base.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-11-19 23:10:45 +0800
committercrupest <crupest@outlook.com>2018-11-19 23:10:45 +0800
commit5291b587708b7f1b9be9187aa4df99ea2cfe0538 (patch)
tree7d5d91ba4a0d979ceefea05bbe99efc47a9bf6a3 /src/ui/ui_base.hpp
parent3edc249f48b4d7e692c782c1ca4809e07fa0726f (diff)
downloadcru-5291b587708b7f1b9be9187aa4df99ea2cfe0538.tar.gz
cru-5291b587708b7f1b9be9187aa4df99ea2cfe0538.tar.bz2
cru-5291b587708b7f1b9be9187aa4df99ea2cfe0538.zip
Add FrameLayout.
Diffstat (limited to 'src/ui/ui_base.hpp')
-rw-r--r--src/ui/ui_base.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ui/ui_base.hpp b/src/ui/ui_base.hpp
index c20d44b6..d9c9d0b2 100644
--- a/src/ui/ui_base.hpp
+++ b/src/ui/ui_base.hpp
@@ -91,6 +91,21 @@ namespace cru::ui
return top + bottom;
}
+ void SetLeftRight(const float value)
+ {
+ left = right = value;
+ }
+
+ void SetTopBottom(const float value)
+ {
+ top = bottom = value;
+ }
+
+ void SetAll(const float value)
+ {
+ left = top = right = bottom = value;
+ }
+
float Validate() const
{
return left >= 0.0 && top >= 0.0 && right >= 0.0 && bottom >= 0.0;