diff options
author | crupest <crupest@outlook.com> | 2018-10-02 01:09:35 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-10-02 01:09:35 +0800 |
commit | 040a6c18f18100b825a56443a73aa1de64e4518c (patch) | |
tree | a271bddb244fa2041f14f8d46d249457cee09e5f /src/ui/controls/border_delegate.cpp | |
parent | a3b78397f71c35e51681104b572de06a1780e4ee (diff) | |
download | cru-040a6c18f18100b825a56443a73aa1de64e4518c.tar.gz cru-040a6c18f18100b825a56443a73aa1de64e4518c.tar.bz2 cru-040a6c18f18100b825a56443a73aa1de64e4518c.zip |
Make text box use border delegate. Fix layout bug in margin container.
Diffstat (limited to 'src/ui/controls/border_delegate.cpp')
-rw-r--r-- | src/ui/controls/border_delegate.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ui/controls/border_delegate.cpp b/src/ui/controls/border_delegate.cpp index 0b460997..c8855e0f 100644 --- a/src/ui/controls/border_delegate.cpp +++ b/src/ui/controls/border_delegate.cpp @@ -1,7 +1,19 @@ #include "border_delegate.h" +#include "graph/graph.h" namespace cru::ui::controls { + BorderProperty::Ptr BorderProperty::Create() + { + return std::make_shared<BorderProperty>(graph::CreateSolidBrush(D2D1::ColorF(D2D1::ColorF::Black))); + } + + BorderProperty::BorderProperty(Microsoft::WRL::ComPtr<ID2D1Brush> brush) + : brush_(std::move(brush)) + { + + } + void BorderProperty::SetBrush(Microsoft::WRL::ComPtr<ID2D1Brush> brush) { brush_ = std::move(brush); @@ -33,7 +45,7 @@ namespace cru::ui::controls } BorderDelegate::BorderDelegate(Control* control) - : BorderDelegate(control, std::make_shared<BorderProperty>()) + : BorderDelegate(control, BorderProperty::Create()) { } |