diff options
Diffstat (limited to 'include/cru/ui')
-rw-r--r-- | include/cru/ui/ThemeManager.hpp | 17 | ||||
-rw-r--r-- | include/cru/ui/UiManager.hpp | 2 | ||||
-rw-r--r-- | include/cru/ui/controls/RootControl.hpp | 3 |
3 files changed, 14 insertions, 8 deletions
diff --git a/include/cru/ui/ThemeManager.hpp b/include/cru/ui/ThemeManager.hpp index 9908658c..45cd810c 100644 --- a/include/cru/ui/ThemeManager.hpp +++ b/include/cru/ui/ThemeManager.hpp @@ -2,19 +2,20 @@ #include "Base.hpp" #include "cru/common/Base.hpp" #include "cru/common/Event.hpp" +#include "cru/common/Exception.hpp" #include "cru/platform/graphics/Brush.hpp" -#include <boost/property_tree/ptree.hpp> -#include <cstddef> -#include <memory> -#include <stdexcept> -#include <string_view> #include <unordered_map> namespace cru::ui { -class BadThemeResourceException : public std::runtime_error { +class ThemeResourceKeyNotExistException : public Exception { public: - using std::runtime_error::runtime_error; + using Exception::Exception; +}; + +class BadThemeResourceException : public Exception { + public: + using Exception::Exception; }; class ThemeManager : public Object { @@ -42,7 +43,7 @@ class ThemeManager : public Object { private: Event<std::nullptr_t> theme_resource_change_event_; - boost::property_tree::ptree theme_tree_; + std::unordered_map<String, String> theme_resource_map_; std::unordered_map<String, std::shared_ptr<platform::graphics::IBrush>> brushes_; }; diff --git a/include/cru/ui/UiManager.hpp b/include/cru/ui/UiManager.hpp index 6b1083b2..e617dea8 100644 --- a/include/cru/ui/UiManager.hpp +++ b/include/cru/ui/UiManager.hpp @@ -18,7 +18,9 @@ struct ThemeResources { std::shared_ptr<platform::graphics::IBrush> text_brush; std::shared_ptr<platform::graphics::IBrush> text_selection_brush; std::shared_ptr<platform::graphics::IBrush> caret_brush; + style::StyleRuleSet button_style; + style::StyleRuleSet text_box_style; style::StyleRuleSet menu_item_style; diff --git a/include/cru/ui/controls/RootControl.hpp b/include/cru/ui/controls/RootControl.hpp index 823b9f03..c3f3da9f 100644 --- a/include/cru/ui/controls/RootControl.hpp +++ b/include/cru/ui/controls/RootControl.hpp @@ -4,6 +4,7 @@ #include "cru/common/Base.hpp" #include "cru/common/Event.hpp" #include "cru/platform/gui/Base.hpp" +#include "cru/platform/gui/Window.hpp" #include "cru/ui/Base.hpp" #include "cru/ui/host/WindowHost.hpp" @@ -20,6 +21,8 @@ class RootControl : public LayoutControl { public: render::RenderObject* GetRenderObject() const override; + platform::gui::INativeWindow* GetNativeWindow(); + protected: void SetGainFocusOnCreateAndDestroyWhenLoseFocus(bool value); |