aboutsummaryrefslogtreecommitdiff
path: root/src/ui/UiManager.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-25 18:39:14 +0800
committercrupest <crupest@outlook.com>2022-01-25 18:39:14 +0800
commitd3aa43d9ea0dfc32935767cf60a89af2736dc339 (patch)
treee8cf043ac6d9a2e6ce038ad6b1f57079834ef129 /src/ui/UiManager.cpp
parent71c01a175a939d1a519ab235fdfdeec1101f8b84 (diff)
downloadcru-d3aa43d9ea0dfc32935767cf60a89af2736dc339.tar.gz
cru-d3aa43d9ea0dfc32935767cf60a89af2736dc339.tar.bz2
cru-d3aa43d9ea0dfc32935767cf60a89af2736dc339.zip
...
Diffstat (limited to 'src/ui/UiManager.cpp')
-rw-r--r--src/ui/UiManager.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/ui/UiManager.cpp b/src/ui/UiManager.cpp
index e374cc2e..62dce6a7 100644
--- a/src/ui/UiManager.cpp
+++ b/src/ui/UiManager.cpp
@@ -3,6 +3,7 @@
#include "Helper.hpp"
#include "cru/common/io/FileStream.hpp"
#include "cru/common/io/OpenFileFlag.hpp"
+#include "cru/common/io/Resource.hpp"
#include "cru/platform/graphics/Brush.hpp"
#include "cru/platform/graphics/Factory.hpp"
#include "cru/platform/graphics/Font.hpp"
@@ -37,9 +38,14 @@ UiManager* UiManager::GetInstance() {
UiManager::UiManager() {
const auto factory = GetGraphicsFactory();
- // TODO: Resource file path!!!
- ReadResourcesFile(
- u"/Users/crupest/codes/cru/assets/cru/ui/DefaultResources.xml");
+ std::filesystem::path resourses_file =
+ cru::io::GetResourceDir() / "cru/ui/DefaultResources.xml";
+
+ if (!std::filesystem::exists(resourses_file)) {
+ throw Exception(u"Default resources file not found.");
+ }
+
+ ReadResourcesFile(String::FromStdPath(resourses_file));
theme_resource_.default_font_family = u"";