From 3c9fe89636553484f93b9729e6ca8974a16a01b2 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Tue, 23 Jul 2019 11:11:40 +0100 Subject: [PATCH] Added a method for changing the corner size of a CallOutBox --- modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp | 5 +++++ modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h | 1 + modules/juce_gui_basics/windows/juce_CallOutBox.cpp | 2 +- modules/juce_gui_basics/windows/juce_CallOutBox.h | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp index b357db1717..f147120004 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp @@ -2513,6 +2513,11 @@ int LookAndFeel_V2::getCallOutBoxBorderSize (const CallOutBox&) return 20; } +float LookAndFeel_V2::getCallOutBoxCornerSize (const CallOutBox&) +{ + return 9.0f; +} + //============================================================================== AttributedString LookAndFeel_V2::createFileChooserHeaderText (const String& title, const String& instructions) diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h index 4920f83753..b1113325d3 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h @@ -327,6 +327,7 @@ public: //============================================================================== void drawCallOutBoxBackground (CallOutBox&, Graphics&, const Path& path, Image& cachedImage) override; int getCallOutBoxBorderSize (const CallOutBox&) override; + float getCallOutBoxCornerSize (const CallOutBox&) override; //============================================================================== void drawLevelMeter (Graphics&, int width, int height, float level) override; diff --git a/modules/juce_gui_basics/windows/juce_CallOutBox.cpp b/modules/juce_gui_basics/windows/juce_CallOutBox.cpp index b772533b18..a101816350 100644 --- a/modules/juce_gui_basics/windows/juce_CallOutBox.cpp +++ b/modules/juce_gui_basics/windows/juce_CallOutBox.cpp @@ -254,7 +254,7 @@ void CallOutBox::refreshPath() outline.addBubble (content.getBounds().toFloat().expanded (gap, gap), getLocalBounds().toFloat(), targetPoint - getPosition().toFloat(), - 9.0f, arrowSize * 0.7f); + getLookAndFeel().getCallOutBoxCornerSize (*this), arrowSize * 0.7f); } void CallOutBox::timerCallback() diff --git a/modules/juce_gui_basics/windows/juce_CallOutBox.h b/modules/juce_gui_basics/windows/juce_CallOutBox.h index f917c41bac..c4572b831b 100644 --- a/modules/juce_gui_basics/windows/juce_CallOutBox.h +++ b/modules/juce_gui_basics/windows/juce_CallOutBox.h @@ -145,6 +145,7 @@ public: virtual void drawCallOutBoxBackground (CallOutBox&, Graphics&, const Path&, Image&) = 0; virtual int getCallOutBoxBorderSize (const CallOutBox&) = 0; + virtual float getCallOutBoxCornerSize (const CallOutBox&) = 0; }; //==============================================================================