aboutsummaryrefslogtreecommitdiff
path: root/src/ui/ui_manager.cpp
blob: b1132ea88163713276dc013fe0da2a4c751b9f7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "cru/ui/ui_manager.hpp"

#include "cru/platform/brush.hpp"
#include "cru/platform/font.hpp"
#include "cru/platform/graph_factory.hpp"
#include "cru/platform/ui_applicaition.hpp"

namespace cru::ui {
PredefineResources::PredefineResources() {
  const auto graph_factory =
      platform::UiApplication::GetInstance()->GetGraphFactory();

  button_normal_border_brush.reset(static_cast<platform::Brush*>(
      graph_factory->CreateSolidColorBrush(colors::black)));
  text_block_selection_brush.reset(static_cast<platform::Brush*>(
      graph_factory->CreateSolidColorBrush(colors::skyblue)));
  text_block_text_brush.reset(static_cast<platform::Brush*>(
      graph_factory->CreateSolidColorBrush(colors::black)));
  text_block_font.reset(graph_factory->CreateFontDescriptor(L"等线", 24.0f));
}

UiManager* UiManager::GetInstance() {
  static UiManager instance;
  return &instance;
}

UiManager::UiManager() : predefine_resources_(new PredefineResources()) {}
}  // namespace cru::ui