aboutsummaryrefslogtreecommitdiff
path: root/CruUI/ui/controls/linear_layout.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-09-08 23:31:20 +0800
committercrupest <crupest@outlook.com>2018-09-08 23:31:20 +0800
commit74031db4b8c366531db5be8fa8d765483ab377b0 (patch)
tree558ed98f22eb182b7d7017e5a51bdb14d5e92268 /CruUI/ui/controls/linear_layout.h
parent7cbe80c19170c8c742fd280c555eafbd2a51b4da (diff)
downloadcru-74031db4b8c366531db5be8fa8d765483ab377b0.tar.gz
cru-74031db4b8c366531db5be8fa8d765483ab377b0.tar.bz2
cru-74031db4b8c366531db5be8fa8d765483ab377b0.zip
...
Diffstat (limited to 'CruUI/ui/controls/linear_layout.h')
-rw-r--r--CruUI/ui/controls/linear_layout.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/CruUI/ui/controls/linear_layout.h b/CruUI/ui/controls/linear_layout.h
new file mode 100644
index 00000000..b8722b6f
--- /dev/null
+++ b/CruUI/ui/controls/linear_layout.h
@@ -0,0 +1,25 @@
+#pragma once
+
+#include "ui/control.h"
+
+namespace cru::ui::controls
+{
+ class LinearLayout : public Control
+ {
+ public:
+ enum class Orientation
+ {
+ Horizontal,
+ Vertical
+ };
+
+ explicit LinearLayout(Orientation orientation = Orientation::Vertical);
+
+ protected:
+ Size OnMeasure(const Size& available_size) override;
+ void OnLayout(const Rect& rect) override;
+
+ private:
+ Orientation orientation_;
+ };
+}