commit b35abd0123bc0efbb09d230e5ed7e82240a9fb42 parent a3aadfd8d400357ef3bd4b96442343f4bd93b041 Author: dsp56300 <dsp56300@users.noreply.github.com> Date: Mon, 16 Dec 2024 23:04:28 +0100 allow styles to inherit from other styles Diffstat:
M | source/juceUiLib/uiObject.cpp | | | 13 | +++++++++++++ |
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/source/juceUiLib/uiObject.cpp b/source/juceUiLib/uiObject.cpp @@ -525,6 +525,19 @@ namespace genericUI m_styles.insert({name, s.value}); } + + for (const auto& [name,s] : m_styles) + { + if (auto* styleObj = s.getDynamicObject()) + { + auto parentStyleName = styleObj->getProperty("style").toString().toStdString(); + + if (!parentStyleName.empty()) + { + applyStyle(*styleObj, parentStyleName); + } + } + } } else if(key == "tabgroup") {