Skip to content

Commit

Permalink
WIP style sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
jurihock committed Dec 23, 2023
1 parent bbe4698 commit 1cbf28a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/StftPitchShiftPlugin/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ Editor::Editor(juce::AudioProcessor& process, std::shared_ptr<Parameters> parame
juce::AudioProcessorEditor(process),
parameters(parameters)
{
jive::Interpreter interpreter;
juce::String style(
R"({
".footer": {
"background": "#ff00ff"
}
})");

juce::String xml(
R"(
Expand Down Expand Up @@ -65,7 +70,7 @@ Editor::Editor(juce::AudioProcessor& process, std::shared_ptr<Parameters> parame
</Component>
<Component {flex-row}>
<Component class="footer" {flex-row}>
<Component {flex-col} {flex-fill}>
<Name id="bypass-name"/>
<Checkbox id="bypass-button"/>
Expand Down Expand Up @@ -101,7 +106,13 @@ Editor::Editor(juce::AudioProcessor& process, std::shared_ptr<Parameters> parame
xml = xml.replace("{flex-row}", R"(display="flex" flex-direction="row")");
xml = xml.replace("{flex-col}", R"(display="flex" flex-direction="column")");

auto* root = (view = interpreter.interpret(xml))->getComponent().get();
jive::Interpreter interpreter;

auto tree = jive::parseXML(xml);
tree.setProperty("style", style, nullptr);

view = interpreter.interpret(tree);
auto* root = view->getComponent().get();

auto attach_checkbox = [&](const std::string& id)
{
Expand Down

0 comments on commit 1cbf28a

Please sign in to comment.