From 103bcb137273729a0f23ff3771e26150a64454ba Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 27 Jan 2022 21:37:38 +0800 Subject: ... --- src/ui/controls/Button.cpp | 1 - src/ui/controls/TextBlock.cpp | 10 ++++++---- src/ui/controls/TextBox.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/ui/controls') diff --git a/src/ui/controls/Button.cpp b/src/ui/controls/Button.cpp index 887bcae6..1f649819 100644 --- a/src/ui/controls/Button.cpp +++ b/src/ui/controls/Button.cpp @@ -5,7 +5,6 @@ #include "cru/platform/gui/Cursor.hpp" #include "cru/platform/gui/UiApplication.hpp" #include "cru/ui/ThemeManager.hpp" -#include "cru/ui/UiManager.hpp" #include "cru/ui/helper/ClickDetector.hpp" #include "cru/ui/render/BorderRenderObject.hpp" diff --git a/src/ui/controls/TextBlock.cpp b/src/ui/controls/TextBlock.cpp index 16fd5df6..b4d327f3 100644 --- a/src/ui/controls/TextBlock.cpp +++ b/src/ui/controls/TextBlock.cpp @@ -1,6 +1,6 @@ #include "cru/ui/controls/TextBlock.hpp" -#include "cru/ui/UiManager.hpp" +#include "cru/ui/ThemeManager.hpp" #include "cru/ui/render/CanvasRenderObject.hpp" #include "cru/ui/render/StackLayoutRenderObject.hpp" #include "cru/ui/render/TextRenderObject.hpp" @@ -18,11 +18,13 @@ TextBlock* TextBlock::Create(String text, bool selectable) { } TextBlock::TextBlock() { - const auto theme_resources = UiManager::GetInstance()->GetThemeResources(); + const auto theme_manager = ThemeManager::GetInstance(); text_render_object_ = std::make_unique( - theme_resources->text_brush, theme_resources->default_font, - theme_resources->text_selection_brush, theme_resources->caret_brush); + theme_manager->GetResourceBrush(u"text.brush"), + theme_manager->GetResourceFont(u"text.font"), + theme_manager->GetResourceBrush(u"text.selection.brush"), + theme_manager->GetResourceBrush(u"text.caret.brush")); text_render_object_->SetAttachedControl(this); diff --git a/src/ui/controls/TextBox.cpp b/src/ui/controls/TextBox.cpp index 20e89028..a5c8480e 100644 --- a/src/ui/controls/TextBox.cpp +++ b/src/ui/controls/TextBox.cpp @@ -1,7 +1,6 @@ #include "cru/ui/controls/TextBox.hpp" #include "cru/ui/ThemeManager.hpp" -#include "cru/ui/UiManager.hpp" #include "cru/ui/render/BorderRenderObject.hpp" #include "cru/ui/render/CanvasRenderObject.hpp" #include "cru/ui/render/ScrollRenderObject.hpp" @@ -16,12 +15,13 @@ using render::TextRenderObject; TextBox::TextBox() : border_render_object_(new BorderRenderObject()), scroll_render_object_(new ScrollRenderObject()) { - const auto theme_resources = UiManager::GetInstance()->GetThemeResources(); auto theme_manager = ThemeManager::GetInstance(); text_render_object_ = std::make_unique( - theme_resources->text_brush, theme_resources->default_font, - theme_resources->text_selection_brush, theme_resources->caret_brush); + theme_manager->GetResourceBrush(u"text.brush"), + theme_manager->GetResourceFont(u"text.font"), + theme_manager->GetResourceBrush(u"text.selection.brush"), + theme_manager->GetResourceBrush(u"text.caret.brush")); text_render_object_->SetEditMode(true); border_render_object_->AddChild(scroll_render_object_.get(), 0); -- cgit v1.2.3