From b16995da4193e164f52a0d6b698a8625d9b253b3 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 6 Aug 2012 16:50:10 +0100 Subject: [PATCH] Minor update to ConcertinaPanel --- .../Application/jucer_AppearanceSettings.cpp | 19 +++++++++++++++++++ .../Application/jucer_AppearanceSettings.h | 3 +++ .../layout/juce_ConcertinaPanel.cpp | 1 + 3 files changed, 23 insertions(+) diff --git a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp index 1c437b7eca..5af2bcb1d0 100644 --- a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp +++ b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp @@ -689,3 +689,22 @@ void IntrojucerLookAndFeel::fillWithBackgroundTexture (Graphics& g) g.setTiledImageFill (backgroundTexture, 0, 0, 1.0f); g.fillAll(); } + +void IntrojucerLookAndFeel::drawConcertinaPanelHeader (Graphics& g, const Rectangle& area, + bool isMouseOver, bool isMouseDown, + ConcertinaPanel& concertina, Component& panel) +{ + const Colour bkg (findColour (mainBackgroundColourId)); + + g.setGradientFill (ColourGradient (Colours::white.withAlpha (isMouseOver ? 0.4f : 0.2f), 0, area.getY(), + Colours::darkgrey.withAlpha (0.2f), 0, area.getBottom(), false)); + + g.fillAll(); + g.setColour (bkg.contrasting().withAlpha (0.04f)); + g.fillRect (area.withHeight (1)); + g.fillRect (area.withTop (area.getBottom() - 1)); + + g.setColour (bkg.contrasting()); + g.setFont (Font (area.getHeight() * 0.6f).boldened()); + g.drawFittedText (panel.getName(), 4, 0, area.getWidth() - 6, area.getHeight(), Justification::centredLeft, 1); +} diff --git a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.h b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.h index e771713596..04fae7d41e 100644 --- a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.h +++ b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.h @@ -105,6 +105,9 @@ public: void drawScrollbar (Graphics& g, ScrollBar& scrollbar, int x, int y, int width, int height, bool isScrollbarVertical, int thumbStartPosition, int thumbSize, bool /*isMouseOver*/, bool /*isMouseDown*/); + void drawConcertinaPanelHeader (Graphics& g, const Rectangle& area, + bool isMouseOver, bool isMouseDown, + ConcertinaPanel& concertina, Component& panel); private: Image backgroundTexture; Colour backgroundTextureBaseColour; diff --git a/modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp b/modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp index e51bcdec50..2eab107997 100644 --- a/modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp +++ b/modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp @@ -312,6 +312,7 @@ bool ConcertinaPanel::setPanelSize (Component* panelComponent, int height, const const int index = indexOfComp (panelComponent); jassert (index >= 0); // The specified component doesn't seem to have been added! + height += currentSizes->get(index).minSize; const int oldSize = currentSizes->get(index).size; setLayout (currentSizes->withResizedPanel (index, height, getHeight()), animate); return oldSize != currentSizes->get(index).size;