From b0946c0e6dc163fe981f230302a1976449150907 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 3 Mar 2020 00:39:10 +0800 Subject: ... --- src/ui/ui_manager.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/ui/ui_manager.cpp') diff --git a/src/ui/ui_manager.cpp b/src/ui/ui_manager.cpp index 6c61083b..f71f900f 100644 --- a/src/ui/ui_manager.cpp +++ b/src/ui/ui_manager.cpp @@ -18,15 +18,6 @@ std::unique_ptr CreateSolidColorBrush(IGraphFactory* factory, } } // namespace -PredefineResources::PredefineResources() { - const auto factory = GetGraphFactory(); - - button_normal_border_brush = CreateSolidColorBrush(factory, colors::black); - text_block_selection_brush = CreateSolidColorBrush(factory, colors::skyblue); - text_block_text_brush = CreateSolidColorBrush(factory, colors::black); - text_block_font = factory->CreateFont("等线", 24.0f); -} - UiManager* UiManager::GetInstance() { static UiManager* instance = new UiManager(); GetUiApplication()->AddOnQuitHandler([] { @@ -36,8 +27,15 @@ UiManager* UiManager::GetInstance() { return instance; } -UiManager::UiManager() : predefine_resources_(new PredefineResources()) { +UiManager::UiManager() { const auto factory = GetGraphFactory(); + + theme_resource_.default_font = factory->CreateFont("等线", 24.0f); + + theme_resource_.text_brush = CreateSolidColorBrush(factory, colors::black); + theme_resource_.text_selection_brush = + CreateSolidColorBrush(factory, colors::skyblue); + theme_resource_.button_style.normal.border_brush = CreateSolidColorBrush(factory, Color::FromHex(0x00bfff)); theme_resource_.button_style.hover.border_brush = -- cgit v1.2.3