diff --git a/include/sst/jucegui/components/GlyphPainter.h b/include/sst/jucegui/components/GlyphPainter.h index a8c76fb..7735170 100644 --- a/include/sst/jucegui/components/GlyphPainter.h +++ b/include/sst/jucegui/components/GlyphPainter.h @@ -43,7 +43,9 @@ struct GlyphPainter : public juce::Component, JOG_LEFT, JOG_RIGHT, - BIG_PLUS + BIG_PLUS, + + HAMBURGER } glyph; struct Styles : ControlStyles diff --git a/src/sst/jucegui/components/GlyphPainter.cpp b/src/sst/jucegui/components/GlyphPainter.cpp index 421b1e9..69ffb56 100644 --- a/src/sst/jucegui/components/GlyphPainter.cpp +++ b/src/sst/jucegui/components/GlyphPainter.cpp @@ -170,6 +170,23 @@ static void paintBigPlusGlyph(juce::Graphics &g, const juce::Rectangle &int g.drawLine(0, h * 0.5, h, h * 0.5, 1.5); g.drawLine(h * 0.5, 0, h * 0.5, h, 1.5); } + +static void paintHamburgerGlyph(juce::Graphics &g, const juce::Rectangle &into) +{ + auto sq = centeredSquareIn(into).reduced(1, 1); + auto h = sq.getHeight(); + auto w = sq.getWidth(); + + auto grd = juce::Graphics::ScopedSaveState(g); + g.addTransform(juce::AffineTransform().translated(sq.getX(), sq.getY())); + + auto rh = juce::Rectangle(2, h * 0.3 - 0.5, w - 4, 1); + g.fillRoundedRectangle(rh.toFloat(), 1); + rh = rh.translated(0, h * 0.2); + g.fillRoundedRectangle(rh.toFloat(), 1); + rh = rh.translated(0, h * 0.2); + g.fillRoundedRectangle(rh.toFloat(), 1); +} void GlyphPainter::paint(juce::Graphics &g) { g.setColour(getColour(Styles::controlLabelCol)); @@ -212,6 +229,10 @@ void GlyphPainter::paintGlyph(juce::Graphics &g, const juce::Rectangle &int paintBigPlusGlyph(g, into); return; + case HAMBURGER: + paintHamburgerGlyph(g, into); + return; + default: { auto w = std::min(into.getHeight(), into.getWidth());