From 32aa6f116acc6e3e20a1ec76cef45b29f7005ad7 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Fri, 17 Oct 2025 12:06:14 +0800 Subject: Remove String stage 1. --- include/cru/ui/ThemeManager.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'include/cru/ui/ThemeManager.h') diff --git a/include/cru/ui/ThemeManager.h b/include/cru/ui/ThemeManager.h index 72ade899..10d90060 100644 --- a/include/cru/ui/ThemeManager.h +++ b/include/cru/ui/ThemeManager.h @@ -27,7 +27,7 @@ class CRU_UI_API ThemeManager : public Object { std::unique_ptr theme_resource_dictionary); template - T GetResource(const String& key) { + T GetResource(std::string_view key) { for (const auto& resource_dictionary : theme_resource_dictionary_list_) { try { return resource_dictionary->GetResource(key); @@ -35,18 +35,19 @@ class CRU_UI_API ThemeManager : public Object { } } throw ThemeResourceKeyNotExistException( - std::format("Theme resource key {} not exist.", key.ToUtf8())); + std::format("Theme resource key {} not exist.", key)); } - String GetResourceString(const String& key); + std::string GetResourceString(std::string_view key); std::shared_ptr GetResourceBrush( - const String& key); + std::string_view key); - std::shared_ptr GetResourceFont(const String& key); + std::shared_ptr GetResourceFont( + std::string_view key); std::shared_ptr GetResourceStyleRuleSet( - const String& key); + std::string_view key); IEvent* ThemeResourceChangeEvent() { return &theme_resource_change_event_; -- cgit v1.2.3