aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/margin_container.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-10-04 01:47:49 +0800
committercrupest <crupest@outlook.com>2018-10-04 01:47:49 +0800
commit01ab4511d3006e9f65ff96ae63b21de14b41bc48 (patch)
treee4fa991e7784571c164301ff7ade5aa1ef515744 /src/ui/controls/margin_container.cpp
parent30ecda8bb354d5982978af97aa90b5f49d9ea195 (diff)
downloadcru-01ab4511d3006e9f65ff96ae63b21de14b41bc48.tar.gz
cru-01ab4511d3006e9f65ff96ae63b21de14b41bc48.tar.bz2
cru-01ab4511d3006e9f65ff96ae63b21de14b41bc48.zip
...
Diffstat (limited to 'src/ui/controls/margin_container.cpp')
-rw-r--r--src/ui/controls/margin_container.cpp35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/ui/controls/margin_container.cpp b/src/ui/controls/margin_container.cpp
deleted file mode 100644
index 12dde025..00000000
--- a/src/ui/controls/margin_container.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "margin_container.h"
-
-namespace cru::ui::controls
-{
- inline float AtLeast0(const float value)
- {
- return value < 0 ? 0 : value;
- }
-
- inline Size AtLeast0(const Size& size)
- {
- return Size(AtLeast0(size.width), AtLeast0(size.height));
- }
-
- MarginContainer::MarginContainer(const Thickness& margin)
- : Control(true), margin_(margin)
- {
- }
-
- void MarginContainer::SetMargin(const Thickness& margin)
- {
- margin_ = margin;
- InvalidateLayout();
- }
-
- Size MarginContainer::OnMeasure(const Size& available_size)
- {
- return DefaultMeasureWithPadding(available_size, margin_);
- }
-
- void MarginContainer::OnLayout(const Rect& rect)
- {
- DefaultLayoutWithPadding(rect, margin_);
- }
-}