diff options
-rw-r--r-- | include/cru/ui/UiManager.hpp | 2 | ||||
-rw-r--r-- | include/cru/ui/style/StyleRuleSet.hpp | 2 | ||||
-rw-r--r-- | src/ui/style/StyleRuleSet.cpp | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/include/cru/ui/UiManager.hpp b/include/cru/ui/UiManager.hpp index e747fcd2..6c0d9500 100644 --- a/include/cru/ui/UiManager.hpp +++ b/include/cru/ui/UiManager.hpp @@ -16,6 +16,8 @@ struct ThemeResources { std::shared_ptr<platform::graphics::IBrush> caret_brush; style::StyleRuleSet button_style; style::StyleRuleSet text_box_style; + + style::StyleRuleSet menu_item_style; }; class UiManager : public Object { diff --git a/include/cru/ui/style/StyleRuleSet.hpp b/include/cru/ui/style/StyleRuleSet.hpp index ba3f8b4c..e62dd2de 100644 --- a/include/cru/ui/style/StyleRuleSet.hpp +++ b/include/cru/ui/style/StyleRuleSet.hpp @@ -41,7 +41,7 @@ class StyleRuleSet : public Object { void Clear() { RemoveStyleRule(0, GetSize()); } - void Set(const StyleRuleSet& other); + void Set(const StyleRuleSet& other, bool set_parent = false); const StyleRule& operator[](gsl::index index) const { return rules_[index]; } diff --git a/src/ui/style/StyleRuleSet.cpp b/src/ui/style/StyleRuleSet.cpp index 24b88af9..537d1956 100644 --- a/src/ui/style/StyleRuleSet.cpp +++ b/src/ui/style/StyleRuleSet.cpp @@ -36,8 +36,9 @@ void StyleRuleSet::RemoveStyleRule(gsl::index index, gsl::index count) { RaiseChangeEvent(); } -void StyleRuleSet::Set(const StyleRuleSet& other) { +void StyleRuleSet::Set(const StyleRuleSet& other, bool set_parent) { rules_ = other.rules_; + if (set_parent) parent_ = other.parent_; RaiseChangeEvent(); } |