diff --git a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h index 8936f46122..cb46a0e332 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h +++ b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h @@ -311,6 +311,7 @@ public: virtual Rectangle getTabButtonExtraComponentBounds (const TabBarButton&, Rectangle& textArea, Component& extraComp) = 0; virtual void drawTabButton (TabBarButton&, Graphics&, bool isMouseOver, bool isMouseDown) = 0; + virtual Font getTabButtonFont (TabBarButton&, float height) = 0; virtual void drawTabButtonText (TabBarButton&, Graphics&, bool isMouseOver, bool isMouseDown) = 0; virtual void drawTabbedButtonBarBackground (TabbedButtonBar&, Graphics&) = 0; virtual void drawTabAreaBehindFrontButton (TabbedButtonBar&, Graphics&, int w, int h) = 0; diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp index 44aa81bdd9..4622efd7b4 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp @@ -2171,6 +2171,11 @@ void LookAndFeel_V2::fillTabButtonShape (TabBarButton& button, Graphics& g, cons g.strokePath (path, PathStrokeType (isFrontTab ? 1.0f : 0.5f)); } +Font LookAndFeel_V2::getTabButtonFont (TabBarButton&, float height) +{ + return { height * 0.6f }; +} + void LookAndFeel_V2::drawTabButtonText (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown) { const Rectangle area (button.getTextArea().toFloat()); @@ -2181,7 +2186,7 @@ void LookAndFeel_V2::drawTabButtonText (TabBarButton& button, Graphics& g, bool if (button.getTabbedButtonBar().isVertical()) std::swap (length, depth); - Font font (depth * 0.6f); + Font font (getTabButtonFont (button, depth)); font.setUnderline (button.hasKeyboardFocus (false)); AffineTransform t; diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h index 227490c7bc..268f22a6d7 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.h @@ -274,6 +274,7 @@ public: Rectangle getTabButtonExtraComponentBounds (const TabBarButton&, Rectangle& textArea, Component& extraComp) override; void drawTabButton (TabBarButton&, Graphics&, bool isMouseOver, bool isMouseDown) override; + Font getTabButtonFont (TabBarButton&, float height) override; void drawTabButtonText (TabBarButton&, Graphics&, bool isMouseOver, bool isMouseDown) override; void drawTabbedButtonBarBackground (TabbedButtonBar&, Graphics&) override; void drawTabAreaBehindFrontButton (TabbedButtonBar&, Graphics&, int w, int h) override;