diff options
author | crupest <crupest@outlook.com> | 2018-09-20 22:50:37 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-09-20 22:50:37 +0800 |
commit | 5f7d3268e3d2ea84a1afc97c209b703bf4092c76 (patch) | |
tree | 8cab3c7457420b55376e5825f0cdfefd47551c00 /CruUI/ui/controls/linear_layout.h | |
parent | 6cd7b4e168fdda6bf83187cda9269cad5f9ee0ed (diff) | |
download | cru-5f7d3268e3d2ea84a1afc97c209b703bf4092c76.tar.gz cru-5f7d3268e3d2ea84a1afc97c209b703bf4092c76.tar.bz2 cru-5f7d3268e3d2ea84a1afc97c209b703bf4092c76.zip |
Improve linear layout.
Diffstat (limited to 'CruUI/ui/controls/linear_layout.h')
-rw-r--r-- | CruUI/ui/controls/linear_layout.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/CruUI/ui/controls/linear_layout.h b/CruUI/ui/controls/linear_layout.h index ead56081..7c1fb2a8 100644 --- a/CruUI/ui/controls/linear_layout.h +++ b/CruUI/ui/controls/linear_layout.h @@ -6,7 +6,20 @@ namespace cru::ui::controls { class LinearLayout : public Control { + private: + constexpr static auto alignment_key = L"linear_layout_alignment"; + public: + static Alignment GetAlignment(Control* control) + { + return control->GetAdditionalProperty<Alignment>(alignment_key).value_or(Alignment::Center); + } + + static void SetAlignment(Control* control, Alignment alignment) + { + control->SetAdditionalProperty(alignment_key, alignment); + } + enum class Orientation { Horizontal, |