diff options
author | crupest <crupest@outlook.com> | 2018-10-02 00:32:21 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-10-02 00:32:21 +0800 |
commit | f55a20fd3bad952481339d47ff844ad816192f50 (patch) | |
tree | f06fef6ae60052ada11e41650b443565eeb5447e /src/ui/controls/button.cpp | |
parent | 3b7e3d0ca26b526c8c4e6fc335085ac28d63bbab (diff) | |
download | cru-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.cpp | 10 |
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_); |