From c847eb8e1d053a49f1162ea2f2e4aeab299e6bbc Mon Sep 17 00:00:00 2001 From: jatin Date: Fri, 10 Jan 2025 22:20:20 -0800 Subject: [PATCH] Silencing JUCE 7/8 deprecation warnings --- modules/gui/chowdsp_gui/PluginComponents/chowdsp_InfoComp.cpp | 4 ++++ .../chowdsp_gui/PluginComponents/chowdsp_ParametersView.cpp | 2 ++ .../gui/chowdsp_gui/PluginComponents/chowdsp_TitleComp.cpp | 2 ++ .../gui/chowdsp_gui/PluginComponents/chowdsp_TooltipComp.cpp | 2 ++ 4 files changed, 10 insertions(+) diff --git a/modules/gui/chowdsp_gui/PluginComponents/chowdsp_InfoComp.cpp b/modules/gui/chowdsp_gui/PluginComponents/chowdsp_InfoComp.cpp index c0605256e..04bbc73a1 100644 --- a/modules/gui/chowdsp_gui/PluginComponents/chowdsp_InfoComp.cpp +++ b/modules/gui/chowdsp_gui/PluginComponents/chowdsp_InfoComp.cpp @@ -23,7 +23,9 @@ void InfoComp::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; @@ -35,7 +37,9 @@ void InfoComp::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); }; diff --git a/modules/gui/chowdsp_gui/PluginComponents/chowdsp_ParametersView.cpp b/modules/gui/chowdsp_gui/PluginComponents/chowdsp_ParametersView.cpp index 98df51cbd..340a5de92 100644 --- a/modules/gui/chowdsp_gui/PluginComponents/chowdsp_ParametersView.cpp +++ b/modules/gui/chowdsp_gui/PluginComponents/chowdsp_ParametersView.cpp @@ -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); } diff --git a/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TitleComp.cpp b/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TitleComp.cpp index b7117e3ac..dabbd2c1e 100644 --- a/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TitleComp.cpp +++ b/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TitleComp.cpp @@ -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); }; diff --git a/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TooltipComp.cpp b/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TooltipComp.cpp index 4d4418efd..15b3481c4 100644 --- a/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TooltipComp.cpp +++ b/modules/gui/chowdsp_gui/PluginComponents/chowdsp_TooltipComp.cpp @@ -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);