Skip to content

Commit

Permalink
- fixed some CSS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph-hart committed Sep 25, 2024
1 parent e8696ea commit 8cdac4e
Show file tree
Hide file tree
Showing 11 changed files with 1,396 additions and 7 deletions.
2 changes: 1 addition & 1 deletion currentGitHash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5cedf8a3f6aa6627b2e15e0449cbe4754ba18114
e8696eada2ae6a126a4e711df4e6218eb3a0eb7a
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 "5cedf8a3f6aa6627b2e15e0449cbe4754ba18114"
#define PREVIOUS_HISE_COMMIT "e8696eada2ae6a126a4e711df4e6218eb3a0eb7a"
17 changes: 17 additions & 0 deletions hi_core/hi_core/MainControllerHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,23 @@ struct ValueToTextConverter
return v.getDoubleValue();
}

static ValueToTextConverter createForMode(const String& modeString)
{
ValueToTextConverter vtc;

#define FUNC(x) if(modeString == #x) { vtc.active = true; vtc.valueToTextFunction = ConverterFunctions::x; vtc.textToValueFunction = InverterFunctions::x; }

FUNC(Frequency);
FUNC(Time);
FUNC(TempoSync);
FUNC(Pan);
FUNC(NormalizedPercentage);

#undef FUNC

return vtc;
}

static ValueToTextConverter fromString(const String& converterString)
{
ValueToTextConverter vtc;
Expand Down
2 changes: 1 addition & 1 deletion hi_core/hi_core/MiscComponents.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ class MultilineLabel : public Label

// ================================================================================================================

MultilineLabel(const String &name);;
MultilineLabel(const String &name={});;
~MultilineLabel() {};

void setMultiline(bool shouldBeMultiline);;
Expand Down
21 changes: 19 additions & 2 deletions hi_dsp_library/node_api/helpers/ParameterData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,25 @@ scriptnode::InvertableParameterRange RangeHelpers::getDoubleRange(const ValueTre

r.rng.start = minValue;
r.rng.end = maxValue;
r.rng.interval = jlimit(0.0, 1.0, (double)PropertyIds::Helpers::getWithDefault(t, ri(set, RangeIdentifier::StepSize)));
r.rng.skew = jlimit(0.001, 100.0, (double)PropertyIds::Helpers::getWithDefault(t, ri(set, RangeIdentifier::SkewFactor)));

auto skewId = ri(set, RangeIdentifier::SkewFactor);
auto stepId = ri(set, RangeIdentifier::StepSize);

if(t.hasProperty(stepId))
r.rng.interval = jlimit(0.0, 1.0, (double)t[stepId]);

if(t.hasProperty(skewId))
{
if(set == IdSet::ScriptComponents)
{
r.rng.setSkewForCentre(jlimit(r.rng.start, r.rng.end, (double)t[skewId]));
}
else
{
r.rng.skew = jlimit(0.001, 100.0, (double)t[skewId]);
}
}


return r;
}
Expand Down
2 changes: 2 additions & 0 deletions hi_tools/mcl_editor/code_editor/TextEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ void TextEditor::timerCallback()

void TextEditor::setNewTokenCollectionForAllChildren(Component* any, const Identifier& languageId, TokenCollection::Ptr newCollection)
{
return;

if(newCollection == nullptr)
newCollection = new TokenCollection(languageId);

Expand Down
11 changes: 11 additions & 0 deletions hi_tools/simple_css/CSSLookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ void StyleSheetLookAndFeel::drawRotarySlider(Graphics& graphics, int x, int y, i

}

void StyleSheetLookAndFeel::drawGenericComponentText(Graphics& g, const String& text, Component* c, Selector s)
{
if(auto ss = s ? root.css.getWithAllStates(c, s) : root.css.getForComponent(c))
{
Renderer r(c, root.stateWatcher);
r.renderText(g, c->getLocalBounds().toFloat(), text, ss);
}
}

bool StyleSheetLookAndFeel::drawComponentBackground(Graphics& g, Component* c, Selector s)
{
if(auto ss = s ? root.css.getWithAllStates(c, s) : root.css.getForComponent(c))
Expand All @@ -214,6 +223,8 @@ bool StyleSheetLookAndFeel::drawComponentBackground(Graphics& g, Component* c, S
r.drawBackground(g, c->getLocalBounds().toFloat(), ss);
return true;
}

return false;
}

bool StyleSheetLookAndFeel::drawListBoxRow(int rowNumber, Graphics& g, const String& text, Component* lb, int width,
Expand Down
2 changes: 2 additions & 0 deletions hi_tools/simple_css/CSSLookAndFeel.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ struct StyleSheetLookAndFeel: public GlobalHiseLookAndFeel,
/** Draws any generic component background. */
bool drawComponentBackground(Graphics& g, Component* c, Selector s = {});

void drawGenericComponentText(Graphics& g, const String& text, Component* c, Selector s = {});

/** Use this for drawing a listbox row by styling the `tr` element. */
bool drawListBoxRow(int rowNumber, Graphics& g, const String& text, Component* lb, int width, int height, bool rowIsSelected,
bool rowIsHovered);
Expand Down
8 changes: 6 additions & 2 deletions hi_tools/simple_css/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,12 @@ void Renderer::drawBackground(Graphics& g, Rectangle<float> area, StyleSheet::Pt
{
auto hc = CSSRootComponent::find(*currentComponent);
ScopedPointer<StyleSheet::Collection::DataProvider> dp = hc->createDataProvider();
auto img = dp->loadImage(imageURL);
drawImage(g, img, area, ss, false);

if(dp != nullptr)
{
auto img = dp->loadImage(imageURL);
drawImage(g, img, area, ss, false);
}
}
else
{
Expand Down
Loading

0 comments on commit 8cdac4e

Please sign in to comment.