Skip to content

Commit

Permalink
Silencing JUCE 7/8 deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Jan 11, 2025
1 parent f59b466 commit c847eb8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/gui/chowdsp_gui/PluginComponents/chowdsp_InfoComp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ void InfoComp<ProcType, InfoProvider>::paint (juce::Graphics& g)

const auto defaultFont = juce::jmin (20.0f, (float) getHeight());
g.setFont (defaultFont);
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
auto fw = g.getCurrentFont().getStringWidthFloat (totalStr);
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
if (fw > width)
{
float s = width / fw;
Expand All @@ -35,7 +37,9 @@ void InfoComp<ProcType, InfoProvider>::paint (juce::Graphics& g)

auto drawText = [&font, &g, &b] (const juce::String& text)
{
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
auto w = font.getStringWidth (text);
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
g.drawFittedText (text, b.removeFromLeft (w), juce::Justification::left, 1);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ namespace parameters_view_detail

parameterName.setBounds (area.removeFromLeft (parameterName
.getFont()
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
.getStringWidth (parameterName.getText())
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
* 11 / 10));
parameterComp->setBounds (area);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ void TitleComp::paint (juce::Graphics& g)

auto drawText = [&curFont, &g, &b] (const juce::String& text)
{
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
auto width = curFont.getStringWidth (text);
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
g.drawFittedText (text, b.removeFromLeft (width), juce::Justification::left, 1);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ void TooltipComponent::paint (juce::Graphics& g)

auto whitespace = juce::String();
auto font = g.getCurrentFont();
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
while (font.getStringWidth (whitespace) < font.getStringWidth (name + ": "))
whitespace += " ";
JUCE_END_IGNORE_WARNINGS_GCC_LIKE

g.setColour (findColour (textColourID));
g.drawMultiLineText (whitespace + tip, b.getX(), b.getY() + (int) font.getHeight() - 3, b.getWidth(), juce::Justification::topLeft);
Expand Down

0 comments on commit c847eb8

Please sign in to comment.