aboutsummaryrefslogtreecommitdiff
path: root/src/ui/control.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-11-09 22:59:38 +0800
committercrupest <crupest@outlook.com>2018-11-09 22:59:38 +0800
commitac4b0f8d438e7a7c2ecd836af8332b5da1e035c9 (patch)
treee5b886f1884fa56dd90059523b1f4dc730bb5003 /src/ui/control.cpp
parent4b219b569c16db6027dd36e4656152f261321c60 (diff)
downloadcru-ac4b0f8d438e7a7c2ecd836af8332b5da1e035c9.tar.gz
cru-ac4b0f8d438e7a7c2ecd836af8332b5da1e035c9.tar.bz2
cru-ac4b0f8d438e7a7c2ecd836af8332b5da1e035c9.zip
Add predefine resource.
Diffstat (limited to 'src/ui/control.cpp')
-rw-r--r--src/ui/control.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ui/control.cpp b/src/ui/control.cpp
index 31910328..1ec2f704 100644
--- a/src/ui/control.cpp
+++ b/src/ui/control.cpp
@@ -8,6 +8,10 @@
#include "exception.hpp"
#include "cru_debug.hpp"
+#ifdef CRU_DEBUG_LAYOUT
+#include "predefine.hpp"
+#endif
+
namespace cru::ui
{
using namespace events;
@@ -391,12 +395,11 @@ namespace cru::ui
#ifdef CRU_DEBUG_LAYOUT
if (GetWindow()->IsDebugLayout())
{
- const auto resource = Application::GetInstance()->GetDebugLayoutResource();
if (padding_geometry_ != nullptr)
- device_context->FillGeometry(padding_geometry_.Get(), resource->padding_brush.Get());
+ device_context->FillGeometry(padding_geometry_.Get(), predefine::GetPredefineResourceComPtr<ID2D1Brush>(predefine::key_debug_layout_padding_brush).Get());
if (margin_geometry_ != nullptr)
- device_context->FillGeometry(margin_geometry_.Get(), resource->margin_brush.Get());
- device_context->DrawRectangle(Convert(GetRect(RectRange::Margin)), resource->out_border_brush.Get());
+ device_context->FillGeometry(margin_geometry_.Get(), predefine::GetPredefineResourceComPtr<ID2D1Brush>(predefine::key_debug_layout_margin_brush).Get());
+ device_context->DrawRectangle(Convert(GetRect(RectRange::Margin)), predefine::GetPredefineResourceComPtr<ID2D1Brush>(predefine::key_debug_layout_out_border_brush).Get());
}
#endif