aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/ThemeManager.h
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-10-17 12:06:14 +0800
committerYuqian Yang <crupest@crupest.life>2025-10-17 12:06:14 +0800
commit32aa6f116acc6e3e20a1ec76cef45b29f7005ad7 (patch)
tree892b71060a88b58d9293d78033000b05818783df /include/cru/ui/ThemeManager.h
parentfaf77949e19dc0d01f75bf8abb783eda70328048 (diff)
downloadcru-32aa6f116acc6e3e20a1ec76cef45b29f7005ad7.tar.gz
cru-32aa6f116acc6e3e20a1ec76cef45b29f7005ad7.tar.bz2
cru-32aa6f116acc6e3e20a1ec76cef45b29f7005ad7.zip
Remove String stage 1.
Diffstat (limited to 'include/cru/ui/ThemeManager.h')
-rw-r--r--include/cru/ui/ThemeManager.h13
1 files changed, 7 insertions, 6 deletions
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<ThemeResourceDictionary> theme_resource_dictionary);
template <typename T>
- 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<T>(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<platform::graphics::IBrush> GetResourceBrush(
- const String& key);
+ std::string_view key);
- std::shared_ptr<platform::graphics::IFont> GetResourceFont(const String& key);
+ std::shared_ptr<platform::graphics::IFont> GetResourceFont(
+ std::string_view key);
std::shared_ptr<style::StyleRuleSet> GetResourceStyleRuleSet(
- const String& key);
+ std::string_view key);
IEvent<std::nullptr_t>* ThemeResourceChangeEvent() {
return &theme_resource_change_event_;