diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/theme_builder/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/theme_builder/components/properties/ColorPropertyEditor.cpp | 7 | ||||
-rw-r--r-- | src/theme_builder/main.cpp | 10 |
3 files changed, 18 insertions, 0 deletions
diff --git a/src/theme_builder/CMakeLists.txt b/src/theme_builder/CMakeLists.txt index dff58874..709c4d76 100644 --- a/src/theme_builder/CMakeLists.txt +++ b/src/theme_builder/CMakeLists.txt @@ -34,4 +34,5 @@ if(APPLE) endif() target_add_resources(cru_theme_builder cru/ui) +target_add_resources(cru_theme_builder cru/theme_builder) target_link_libraries(cru_theme_builder PRIVATE cru_platform_bootstrap cru_ui) diff --git a/src/theme_builder/components/properties/ColorPropertyEditor.cpp b/src/theme_builder/components/properties/ColorPropertyEditor.cpp index 49911f77..89b145a7 100644 --- a/src/theme_builder/components/properties/ColorPropertyEditor.cpp +++ b/src/theme_builder/components/properties/ColorPropertyEditor.cpp @@ -1,6 +1,7 @@ #include "ColorPropertyEditor.h" #include "cru/platform/graphics/Factory.h" #include "cru/ui/Base.h" +#include "cru/ui/ThemeManager.h" namespace cru::theme_builder::components::properties { ColorPropertyEditor::ColorPropertyEditor() { @@ -8,9 +9,15 @@ ColorPropertyEditor::ColorPropertyEditor() { container_.AddChild(&color_cube_); container_.AddChild(&color_text_); + color_cube_.SetBorderEnabled(true); + color_cube_.GetStyleRuleSet()->SetParent( + ui::ThemeManager::GetInstance()->GetResourceStyleRuleSet( + u"cru.theme_builder.color_cube.style")); + color_cube_brush_ = platform::gui::IUiApplication::GetInstance() ->GetGraphicsFactory() ->CreateSolidColorBrush(color_); + color_cube_.SetForegroundBrush(color_cube_brush_); color_text_.SetText(color_.ToString()); diff --git a/src/theme_builder/main.cpp b/src/theme_builder/main.cpp index 7e7faa3d..df03b379 100644 --- a/src/theme_builder/main.cpp +++ b/src/theme_builder/main.cpp @@ -1,8 +1,18 @@ #include "components/MainWindow.h" +#include "cru/common/io/Resource.h" #include "cru/platform/bootstrap/Bootstrap.h" +#include "cru/ui/ThemeManager.h" +#include "cru/ui/ThemeResourceDictionary.h" int main() { using namespace cru::theme_builder; + using namespace cru::ui; + + auto resource_dir = cru::io::GetResourceDir(); + + ThemeManager::GetInstance()->PrependThemeResourceDictionary( + ThemeResourceDictionary::FromFile(resource_dir / + "cru/theme_builder/ThemeResources.xml")); std::unique_ptr<cru::platform::gui::IUiApplication> application( cru::platform::bootstrap::CreateUiApplication()); |