Browse Source

Minor update to ConcertinaPanel

tags/2021-05-28
jules 13 years ago
parent
commit
b16995da41
3 changed files with 23 additions and 0 deletions
  1. +19
    -0
      extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp
  2. +3
    -0
      extras/Introjucer/Source/Application/jucer_AppearanceSettings.h
  3. +1
    -0
      modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp

+ 19
- 0
extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp View File

@@ -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<int>& 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);
}

+ 3
- 0
extras/Introjucer/Source/Application/jucer_AppearanceSettings.h View File

@@ -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<int>& area,
bool isMouseOver, bool isMouseDown,
ConcertinaPanel& concertina, Component& panel);
private:
Image backgroundTexture;
Colour backgroundTextureBaseColour;


+ 1
- 0
modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp View File

@@ -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;


Loading…
Cancel
Save