From ac4b0f8d438e7a7c2ecd836af8332b5da1e035c9 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 9 Nov 2018 22:59:38 +0800 Subject: Add predefine resource. --- src/ui/controls/toggle_button.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ui/controls/toggle_button.cpp') diff --git a/src/ui/controls/toggle_button.cpp b/src/ui/controls/toggle_button.cpp index f35b8bfe..a901f650 100644 --- a/src/ui/controls/toggle_button.cpp +++ b/src/ui/controls/toggle_button.cpp @@ -2,10 +2,10 @@ #include "graph/graph.hpp" #include "ui/animations/animation.hpp" +#include "ui/predefine.hpp" namespace cru::ui::controls { - using graph::CreateSolidBrush; using animations::AnimationBuilder; // ui length parameters of toggle button. @@ -19,8 +19,8 @@ namespace cru::ui::controls { graph::GraphManager::GetInstance()->GetD2D1Factory()->CreateRoundedRectangleGeometry(D2D1::RoundedRect(D2D1::RectF(-half_width, -half_height, half_width, half_height), half_height, half_height), &frame_path_); - on_brush_ = CreateSolidBrush(D2D1::ColorF(D2D1::ColorF::DeepSkyBlue)); - off_brush_ = CreateSolidBrush(D2D1::ColorF(D2D1::ColorF::LightGray)); + on_brush_ = predefine::GetPredefineResourceComPtr(predefine::key_toggle_button_on_brush); + off_brush_ = predefine::GetPredefineResourceComPtr(predefine::key_toggle_button_off_brush); } inline D2D1_POINT_2F ConvertPoint(const Point& point) -- cgit v1.2.3