From 040a6c18f18100b825a56443a73aa1de64e4518c Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 2 Oct 2018 01:09:35 +0800 Subject: Make text box use border delegate. Fix layout bug in margin container. --- src/ui/controls/border_delegate.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/ui/controls/border_delegate.cpp') 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(graph::CreateSolidBrush(D2D1::ColorF(D2D1::ColorF::Black))); + } + + BorderProperty::BorderProperty(Microsoft::WRL::ComPtr brush) + : brush_(std::move(brush)) + { + + } + void BorderProperty::SetBrush(Microsoft::WRL::ComPtr brush) { brush_ = std::move(brush); @@ -33,7 +45,7 @@ namespace cru::ui::controls } BorderDelegate::BorderDelegate(Control* control) - : BorderDelegate(control, std::make_shared()) + : BorderDelegate(control, BorderProperty::Create()) { } -- cgit v1.2.3