aboutsummaryrefslogtreecommitdiff
path: root/src/ui/ui_manager.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-03-03 00:39:10 +0800
committercrupest <crupest@outlook.com>2020-03-03 00:39:10 +0800
commitb0946c0e6dc163fe981f230302a1976449150907 (patch)
tree3786417609ec00e42c0e9a102c39238135dfc9b5 /src/ui/ui_manager.cpp
parentebb8f7beba71fc0d3cd81f60559e4005e05e48d5 (diff)
downloadcru-b0946c0e6dc163fe981f230302a1976449150907.tar.gz
cru-b0946c0e6dc163fe981f230302a1976449150907.tar.bz2
cru-b0946c0e6dc163fe981f230302a1976449150907.zip
...
Diffstat (limited to 'src/ui/ui_manager.cpp')
-rw-r--r--src/ui/ui_manager.cpp18
1 files changed, 8 insertions, 10 deletions
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<ISolidColorBrush> 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 =