Skip to content

Commit

Permalink
- fixed Component.setStyleSheetClass() not working
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph-hart committed Sep 19, 2024
1 parent 029c1b9 commit 3a60657
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion currentGitHash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4e2a0929fb66974efaa1869b61fa9601c69372fc
029c1b9eb8be3ea6ab1b17cbc4b7b03b112dbf00
2 changes: 1 addition & 1 deletion hi_backend/backend/currentGit.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define PREVIOUS_HISE_COMMIT "4e2a0929fb66974efaa1869b61fa9601c69372fc"
#define PREVIOUS_HISE_COMMIT "029c1b9eb8be3ea6ab1b17cbc4b7b03b112dbf00"
9 changes: 6 additions & 3 deletions hi_scripting/scripting/api/ScriptingApiContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1751,9 +1751,12 @@ juce::LookAndFeel* ScriptingApi::Content::ScriptComponent::createLocalLookAndFee
initProperty("textColour");

removePropertyIfDefault = false;

simple_css::Selector classType(simple_css::SelectorType::Class, propertyTree["type"].toString().toLowerCase());
styleSheetProperties.setProperty("class", classType.toString(), nullptr);

if(!styleSheetProperties.hasProperty("class"))
{
simple_css::Selector classType(simple_css::SelectorType::Class, propertyTree["type"].toString().toLowerCase());
styleSheetProperties.setProperty("class", classType.toString(), nullptr);
}

return new ScriptingObjects::ScriptedLookAndFeel::CSSLaf(l, contentComponent, componentToRegister, this->propertyTree, this->styleSheetProperties);
}
Expand Down
7 changes: 5 additions & 2 deletions hi_scripting/scripting/api/ScriptingGraphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2844,8 +2844,11 @@ ScriptingObjects::ScriptedLookAndFeel::CSSLaf::CSSLaf(ScriptedLookAndFeel* paren
safe->getProperties().set(v, classIds);
root->css.clearCache(safe);

auto ptr3 = root->css.getForComponent(safe.getComponent());
ptr3->copyVarProperties(ptr2);
if(auto ptr3 = root->css.getForComponent(safe.getComponent()))
{
ptr3->copyVarProperties(ptr2);
}

}
else

Expand Down

0 comments on commit 3a60657

Please sign in to comment.