aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/button.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-10-02 00:32:21 +0800
committercrupest <crupest@outlook.com>2018-10-02 00:32:21 +0800
commitf55a20fd3bad952481339d47ff844ad816192f50 (patch)
treef06fef6ae60052ada11e41650b443565eeb5447e /src/ui/controls/button.cpp
parent3b7e3d0ca26b526c8c4e6fc335085ac28d63bbab (diff)
downloadcru-f55a20fd3bad952481339d47ff844ad816192f50.tar.gz
cru-f55a20fd3bad952481339d47ff844ad816192f50.tar.bz2
cru-f55a20fd3bad952481339d47ff844ad816192f50.zip
Fix measure system of border.
Diffstat (limited to 'src/ui/controls/button.cpp')
-rw-r--r--src/ui/controls/button.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ui/controls/button.cpp b/src/ui/controls/button.cpp
index 630c0c39..2ecc9f14 100644
--- a/src/ui/controls/button.cpp
+++ b/src/ui/controls/button.cpp
@@ -29,6 +29,16 @@ namespace cru::ui::controls
border_delegate_->Draw(device_context, GetSize());
}
+ Size Button::OnMeasure(const Size& available_size)
+ {
+ return Control::DefaultMeasureWithPadding(available_size, border_delegate_->GetBorderThickness());
+ }
+
+ void Button::OnLayout(const Rect& rect)
+ {
+ Control::DefaultLayoutWithPadding(rect, border_delegate_->GetBorderThickness());
+ }
+
void Button::OnMouseClickBegin(MouseButton button)
{
border_delegate_->SetBorderProperty(pressed_border_border_);