LMMS
Loading...
Searching...
No Matches
juce_LookAndFeel_V3.cpp
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
48
50
52
53void LookAndFeel_V3::drawStretchableLayoutResizerBar (Graphics& g, int /*w*/, int /*h*/, bool /*isVerticalBar*/,
54 bool isMouseOver, bool isMouseDragging)
55{
56 if (isMouseOver || isMouseDragging)
57 g.fillAll (Colours::yellow.withAlpha (0.4f));
58}
59
60void LookAndFeel_V3::drawScrollbar (Graphics& g, ScrollBar& scrollbar, int x, int y, int width, int height,
61 bool isScrollbarVertical, int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown)
62{
63 Path thumbPath;
64
65 if (thumbSize > 0)
66 {
67 const float thumbIndent = (float) (isScrollbarVertical ? width : height) * 0.25f;
68 const float thumbIndentx2 = thumbIndent * 2.0f;
69
70 if (isScrollbarVertical)
71 thumbPath.addRoundedRectangle ((float) x + thumbIndent, (float) thumbStartPosition + thumbIndent,
72 (float) width - thumbIndentx2, (float) thumbSize - thumbIndentx2, ((float) width - thumbIndentx2) * 0.5f);
73 else
74 thumbPath.addRoundedRectangle ((float) thumbStartPosition + thumbIndent, (float) y + thumbIndent,
75 (float) thumbSize - thumbIndentx2, (float) height - thumbIndentx2, ((float) height - thumbIndentx2) * 0.5f);
76 }
77
78 Colour thumbCol (scrollbar.findColour (ScrollBar::thumbColourId, true));
79
80 if (isMouseOver || isMouseDown)
81 thumbCol = thumbCol.withMultipliedAlpha (2.0f);
82
83 g.setColour (thumbCol);
84 g.fillPath (thumbPath);
85
86 g.setColour (thumbCol.contrasting ((isMouseOver || isMouseDown) ? 0.2f : 0.1f));
87 g.strokePath (thumbPath, PathStrokeType (1.0f));
88}
89
91 bool isMouseOver, bool /*isMouseDown*/,
93{
94 const Colour bkg (Colours::grey);
95
96 g.setGradientFill (ColourGradient::vertical (Colours::white.withAlpha (isMouseOver ? 0.4f : 0.2f), (float) area.getY(),
97 Colours::darkgrey.withAlpha (0.1f), (float) area.getBottom()));
98 g.fillAll();
99
100 g.setColour (bkg.contrasting().withAlpha (0.1f));
101 g.fillRect (area.withHeight (1));
102 g.fillRect (area.withTop (area.getBottom() - 1));
103
104 g.setColour (bkg.contrasting());
105 g.setFont (Font ((float) area.getHeight() * 0.6f).boldened());
106 g.drawFittedText (panel.getName(), 4, 0, area.getWidth() - 6, area.getHeight(), Justification::centredLeft, 1);
107}
108
109static void drawButtonShape (Graphics& g, const Path& outline, Colour baseColour, float height)
110{
111 const float mainBrightness = baseColour.getBrightness();
112 const float mainAlpha = baseColour.getFloatAlpha();
113
114 g.setGradientFill (ColourGradient::vertical (baseColour.brighter (0.2f), 0.0f,
115 baseColour.darker (0.25f), height));
116 g.fillPath (outline);
117
118 g.setColour (Colours::white.withAlpha (0.4f * mainAlpha * mainBrightness * mainBrightness));
119 g.strokePath (outline, PathStrokeType (1.0f), AffineTransform::translation (0.0f, 1.0f)
120 .scaled (1.0f, (height - 1.6f) / height));
121
122 g.setColour (Colours::black.withAlpha (0.4f * mainAlpha));
123 g.strokePath (outline, PathStrokeType (1.0f));
124}
125
126void LookAndFeel_V3::drawButtonBackground (Graphics& g, Button& button, const Colour& backgroundColour,
127 bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown)
128{
129 Colour baseColour (backgroundColour.withMultipliedSaturation (button.hasKeyboardFocus (true) ? 1.3f : 0.9f)
130 .withMultipliedAlpha (button.isEnabled() ? 0.9f : 0.5f));
131
132 if (shouldDrawButtonAsDown || shouldDrawButtonAsHighlighted)
133 baseColour = baseColour.contrasting (shouldDrawButtonAsDown ? 0.2f : 0.1f);
134
135 const bool flatOnLeft = button.isConnectedOnLeft();
136 const bool flatOnRight = button.isConnectedOnRight();
137 const bool flatOnTop = button.isConnectedOnTop();
138 const bool flatOnBottom = button.isConnectedOnBottom();
139
140 const float width = (float) button.getWidth() - 1.0f;
141 const float height = (float) button.getHeight() - 1.0f;
142
143 if (width > 0 && height > 0)
144 {
145 const float cornerSize = 4.0f;
146
147 Path outline;
148 outline.addRoundedRectangle (0.5f, 0.5f, width, height, cornerSize, cornerSize,
149 ! (flatOnLeft || flatOnTop),
150 ! (flatOnRight || flatOnTop),
151 ! (flatOnLeft || flatOnBottom),
152 ! (flatOnRight || flatOnBottom));
153
154 drawButtonShape (g, outline, baseColour, height);
155 }
156}
157
159{
160 auto r = header.getLocalBounds();
161 auto outlineColour = header.findColour (TableHeaderComponent::outlineColourId);
162
163 g.setColour (outlineColour);
164 g.fillRect (r.removeFromBottom (1));
165
167 g.fillRect (r);
168
169 g.setColour (outlineColour);
170
171 for (int i = header.getNumColumns (true); --i >= 0;)
172 g.fillRect (header.getColumnPosition (i).removeFromRight (1));
173}
174
175int LookAndFeel_V3::getTabButtonOverlap (int /*tabDepth*/) { return -1; }
177
178void LookAndFeel_V3::createTabTextLayout (const TabBarButton& button, float length, float depth,
179 Colour colour, TextLayout& textLayout)
180{
181 Font font (depth * 0.5f);
182 font.setUnderline (button.hasKeyboardFocus (false));
183
185 s.setJustification (Justification::centred);
186 s.append (button.getButtonText().trim(), font, colour);
187
188 textLayout.createLayout (s, length);
189}
190
191void LookAndFeel_V3::drawTabButton (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown)
192{
193 const Rectangle<int> activeArea (button.getActiveArea());
194
195 const TabbedButtonBar::Orientation o = button.getTabbedButtonBar().getOrientation();
196
197 const Colour bkg (button.getTabBackgroundColour());
198
199 if (button.getToggleState())
200 {
201 g.setColour (bkg);
202 }
203 else
204 {
205 Point<int> p1, p2;
206
207 switch (o)
208 {
209 case TabbedButtonBar::TabsAtBottom: p1 = activeArea.getBottomLeft(); p2 = activeArea.getTopLeft(); break;
210 case TabbedButtonBar::TabsAtTop: p1 = activeArea.getTopLeft(); p2 = activeArea.getBottomLeft(); break;
211 case TabbedButtonBar::TabsAtRight: p1 = activeArea.getTopRight(); p2 = activeArea.getTopLeft(); break;
212 case TabbedButtonBar::TabsAtLeft: p1 = activeArea.getTopLeft(); p2 = activeArea.getTopRight(); break;
213 default: jassertfalse; break;
214 }
215
216 g.setGradientFill (ColourGradient (bkg.brighter (0.2f), p1.toFloat(),
217 bkg.darker (0.1f), p2.toFloat(), false));
218 }
219
220 g.fillRect (activeArea);
221
222 g.setColour (button.findColour (TabbedButtonBar::tabOutlineColourId));
223
224 Rectangle<int> r (activeArea);
225
226 if (o != TabbedButtonBar::TabsAtBottom) g.fillRect (r.removeFromTop (1));
227 if (o != TabbedButtonBar::TabsAtTop) g.fillRect (r.removeFromBottom (1));
228 if (o != TabbedButtonBar::TabsAtRight) g.fillRect (r.removeFromLeft (1));
229 if (o != TabbedButtonBar::TabsAtLeft) g.fillRect (r.removeFromRight (1));
230
231 const float alpha = button.isEnabled() ? ((isMouseOver || isMouseDown) ? 1.0f : 0.8f) : 0.3f;
232
233 Colour col (bkg.contrasting().withMultipliedAlpha (alpha));
234
235 if (TabbedButtonBar* bar = button.findParentComponentOfClass<TabbedButtonBar>())
236 {
239
240 if (bar->isColourSpecified (colID))
241 col = bar->findColour (colID);
242 else if (isColourSpecified (colID))
243 col = findColour (colID);
244 }
245
246 const Rectangle<float> area (button.getTextArea().toFloat());
247
248 float length = area.getWidth();
249 float depth = area.getHeight();
250
251 if (button.getTabbedButtonBar().isVertical())
252 std::swap (length, depth);
253
254 TextLayout textLayout;
255 createTabTextLayout (button, length, depth, col, textLayout);
256
258
259 switch (o)
260 {
261 case TabbedButtonBar::TabsAtLeft: t = t.rotated (MathConstants<float>::pi * -0.5f).translated (area.getX(), area.getBottom()); break;
262 case TabbedButtonBar::TabsAtRight: t = t.rotated (MathConstants<float>::pi * 0.5f).translated (area.getRight(), area.getY()); break;
264 case TabbedButtonBar::TabsAtBottom: t = t.translated (area.getX(), area.getY()); break;
265 default: jassertfalse; break;
266 }
267
268 g.addTransform (t);
269 textLayout.draw (g, Rectangle<float> (length, depth));
270}
271
273{
274 const float shadowSize = 0.15f;
275
276 Rectangle<int> shadowRect, line;
277 ColourGradient gradient (Colours::black.withAlpha (bar.isEnabled() ? 0.08f : 0.04f), 0, 0,
278 Colours::transparentBlack, 0, 0, false);
279
280 switch (bar.getOrientation())
281 {
283 gradient.point1.x = (float) w;
284 gradient.point2.x = (float) w * (1.0f - shadowSize);
285 shadowRect.setBounds ((int) gradient.point2.x, 0, w - (int) gradient.point2.x, h);
286 line.setBounds (w - 1, 0, 1, h);
287 break;
288
290 gradient.point2.x = (float) w * shadowSize;
291 shadowRect.setBounds (0, 0, (int) gradient.point2.x, h);
292 line.setBounds (0, 0, 1, h);
293 break;
294
296 gradient.point1.y = (float) h;
297 gradient.point2.y = (float) h * (1.0f - shadowSize);
298 shadowRect.setBounds (0, (int) gradient.point2.y, w, h - (int) gradient.point2.y);
299 line.setBounds (0, h - 1, w, 1);
300 break;
301
303 gradient.point2.y = (float) h * shadowSize;
304 shadowRect.setBounds (0, 0, w, (int) gradient.point2.y);
305 line.setBounds (0, 0, w, 1);
306 break;
307
308 default: break;
309 }
310
311 g.setGradientFill (gradient);
312 g.fillRect (shadowRect.expanded (2, 2));
313
315 g.fillRect (line);
316}
317
319{
320 if (textEditor.isEnabled())
321 {
322 if (textEditor.hasKeyboardFocus (true) && ! textEditor.isReadOnly())
323 {
324 g.setColour (textEditor.findColour (TextEditor::focusedOutlineColourId));
325 g.drawRect (0, 0, width, height, 2);
326 }
327 else
328 {
329 g.setColour (textEditor.findColour (TextEditor::outlineColourId));
330 g.drawRect (0, 0, width, height);
331 }
332 }
333}
334
336 Colour backgroundColour, bool isOpen, bool isMouseOver)
337{
338 Path p;
339 p.addTriangle (0.0f, 0.0f, 1.0f, isOpen ? 0.0f : 0.5f, isOpen ? 0.5f : 0.0f, 1.0f);
340
341 g.setColour (backgroundColour.contrasting().withAlpha (isMouseOver ? 0.5f : 0.3f));
342 g.fillPath (p, p.getTransformToScaleToFit (area.reduced (2, area.getHeight() / 4), true));
343}
344
346{
347 return false;
348}
349
351{
352 return 20;
353}
354
355void LookAndFeel_V3::drawComboBox (Graphics& g, int width, int height, const bool /*isMouseButtonDown*/,
356 int buttonX, int buttonY, int buttonW, int buttonH, ComboBox& box)
357{
358 g.fillAll (box.findColour (ComboBox::backgroundColourId));
359
360 if (box.isEnabled() && box.hasKeyboardFocus (false))
361 {
362 g.setColour (box.findColour (ComboBox::focusedOutlineColourId));
363 g.drawRect (0, 0, width, height, 2);
364 }
365 else
366 {
367 g.setColour (box.findColour (ComboBox::outlineColourId));
368 g.drawRect (0, 0, width, height);
369 }
370
371 const float arrowX = 0.3f;
372 const float arrowH = 0.2f;
373
374 const auto x = (float) buttonX;
375 const auto y = (float) buttonY;
376 const auto w = (float) buttonW;
377 const auto h = (float) buttonH;
378
379 Path p;
380 p.addTriangle (x + w * 0.5f, y + h * (0.45f - arrowH),
381 x + w * (1.0f - arrowX), y + h * 0.45f,
382 x + w * arrowX, y + h * 0.45f);
383
384 p.addTriangle (x + w * 0.5f, y + h * (0.55f + arrowH),
385 x + w * (1.0f - arrowX), y + h * 0.55f,
386 x + w * arrowX, y + h * 0.55f);
387
388 g.setColour (box.findColour (ComboBox::arrowColourId).withMultipliedAlpha (box.isEnabled() ? 1.0f : 0.3f));
389 g.fillPath (p);
390}
391
393 float sliderPos, float minSliderPos, float maxSliderPos,
394 const Slider::SliderStyle style, Slider& slider)
395{
396 g.fillAll (slider.findColour (Slider::backgroundColourId));
397
399 {
400 const float fx = (float) x, fy = (float) y, fw = (float) width, fh = (float) height;
401
402 Path p;
403
405 p.addRectangle (fx, sliderPos, fw, 1.0f + fh - sliderPos);
406 else
407 p.addRectangle (fx, fy, sliderPos - fx, fh);
408
409 auto baseColour = slider.findColour (Slider::thumbColourId)
410 .withMultipliedSaturation (slider.isEnabled() ? 1.0f : 0.5f)
411 .withMultipliedAlpha (0.8f);
412
413 g.setGradientFill (ColourGradient::vertical (baseColour.brighter (0.08f), 0.0f,
414 baseColour.darker (0.08f), (float) height));
415 g.fillPath (p);
416
417 g.setColour (baseColour.darker (0.2f));
418
420 g.fillRect (fx, sliderPos, fw, 1.0f);
421 else
422 g.fillRect (sliderPos, fy, 1.0f, fh);
423 }
424 else
425 {
426 drawLinearSliderBackground (g, x, y, width, height, sliderPos, minSliderPos, maxSliderPos, style, slider);
427 drawLinearSliderThumb (g, x, y, width, height, sliderPos, minSliderPos, maxSliderPos, style, slider);
428 }
429}
430
432 float /*sliderPos*/,
433 float /*minSliderPos*/,
434 float /*maxSliderPos*/,
435 const Slider::SliderStyle /*style*/, Slider& slider)
436{
437 const float sliderRadius = (float) (getSliderThumbRadius (slider) - 2);
438
439 const Colour trackColour (slider.findColour (Slider::trackColourId));
440 const Colour gradCol1 (trackColour.overlaidWith (Colour (slider.isEnabled() ? 0x13000000 : 0x09000000)));
441 const Colour gradCol2 (trackColour.overlaidWith (Colour (0x06000000)));
442 Path indent;
443
444 if (slider.isHorizontal())
445 {
446 auto iy = (float) y + (float) height * 0.5f - sliderRadius * 0.5f;
447
448 g.setGradientFill (ColourGradient::vertical (gradCol1, iy, gradCol2, iy + sliderRadius));
449
450 indent.addRoundedRectangle ((float) x - sliderRadius * 0.5f, iy, (float) width + sliderRadius, sliderRadius, 5.0f);
451 }
452 else
453 {
454 auto ix = (float) x + (float) width * 0.5f - sliderRadius * 0.5f;
455
456 g.setGradientFill (ColourGradient::horizontal (gradCol1, ix, gradCol2, ix + sliderRadius));
457
458 indent.addRoundedRectangle (ix, (float) y - sliderRadius * 0.5f, sliderRadius, (float) height + sliderRadius, 5.0f);
459 }
460
461 g.fillPath (indent);
462
463 g.setColour (trackColour.contrasting (0.5f));
464 g.strokePath (indent, PathStrokeType (0.5f));
465}
466
468{
471
472 #if ! JUCE_MAC
473 g.setColour (findColour (PopupMenu::textColourId).withAlpha (0.6f));
474 g.drawRect (0, 0, width, height);
475 #endif
476}
477
479 bool, MenuBarComponent& menuBar)
480{
481 auto colour = menuBar.findColour (PopupMenu::backgroundColourId);
482
484
485 g.setColour (colour.contrasting (0.15f));
486 g.fillRect (r.removeFromTop (1));
487 g.fillRect (r.removeFromBottom (1));
488
489 g.setGradientFill (ColourGradient::vertical (colour, 0, colour.darker (0.08f), (float) height));
490 g.fillRect (r);
491}
492
494 Button& button, const String& keyDescription)
495{
496 const Colour textColour (button.findColour (0x100ad01 /*KeyMappingEditorComponent::textColourId*/, true));
497
498 if (keyDescription.isNotEmpty())
499 {
500 if (button.isEnabled())
501 {
502 g.setColour (textColour.withAlpha (button.isDown() ? 0.4f : (button.isOver() ? 0.2f : 0.1f)));
503 g.fillRoundedRectangle (button.getLocalBounds().toFloat(), 4.0f);
504 g.drawRoundedRectangle (button.getLocalBounds().toFloat(), 4.0f, 1.0f);
505 }
506
507 g.setColour (textColour);
508 g.setFont ((float) height * 0.6f);
509 g.drawFittedText (keyDescription, 4, 0, width - 8, height, Justification::centred, 1);
510 }
511 else
512 {
513 const float thickness = 7.0f;
514 const float indent = 22.0f;
515
516 Path p;
517 p.addEllipse (0.0f, 0.0f, 100.0f, 100.0f);
518 p.addRectangle (indent, 50.0f - thickness, 100.0f - indent * 2.0f, thickness * 2.0f);
519 p.addRectangle (50.0f - thickness, indent, thickness * 2.0f, 50.0f - indent - thickness);
520 p.addRectangle (50.0f - thickness, 50.0f + thickness, thickness * 2.0f, 50.0f - indent - thickness);
521 p.setUsingNonZeroWinding (false);
522
523 g.setColour (textColour.darker(0.1f).withAlpha (button.isDown() ? 0.7f : (button.isOver() ? 0.5f : 0.3f)));
524 g.fillPath (p, p.getTransformToScaleToFit (2.0f, 2.0f, (float) width - 4.0f, (float) height - 4.0f, true));
525 }
526
527 if (button.hasKeyboardFocus (false))
528 {
529 g.setColour (textColour.withAlpha (0.4f));
530 g.drawRect (0, 0, width, height);
531 }
532}
533
534
536{
537public:
539 : Button (name), colour (c), normalShape (normal), toggledShape (toggled)
540 {
541 }
542
543 void paintButton (Graphics& g, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
544 {
545 Colour background (Colours::grey);
546
548 background = rw->getBackgroundColour();
549
550 const float cx = (float) getWidth() * 0.5f, cy = (float) getHeight() * 0.5f;
551 const float diam = jmin (cx, cy) * (shouldDrawButtonAsDown ? 0.60f : 0.65f);
552
553 g.setColour (background);
554 g.fillEllipse (cx - diam, cy - diam, diam * 2.0f, diam * 2.0f);
555
556 Colour c (background.contrasting (colour, 0.6f));
557
558 if (! isEnabled())
559 c = c.withAlpha (0.6f);
560 else if (shouldDrawButtonAsHighlighted)
561 c = c.brighter();
562
563 g.setColour (c);
564 g.drawEllipse (cx - diam, cy - diam, diam * 2.0f, diam * 2.0f, diam * 0.2f);
565
567
568 float scale = 0.55f;
569 g.fillPath (p, p.getTransformToScaleToFit (cx - diam * scale, cy - diam * scale,
570 diam * 2.0f * scale, diam * 2.0f * scale, true));
571 }
572
573private:
576
578};
579
581{
582 Path shape;
583 const float crossThickness = 0.25f;
584
585 if (buttonType == DocumentWindow::closeButton)
586 {
587 shape.addLineSegment (Line<float> (0.0f, 0.0f, 1.0f, 1.0f), crossThickness * 1.4f);
588 shape.addLineSegment (Line<float> (1.0f, 0.0f, 0.0f, 1.0f), crossThickness * 1.4f);
589
590 return new LookAndFeel_V3_DocumentWindowButton ("close", Colour (0xffdd1100), shape, shape);
591 }
592
593 if (buttonType == DocumentWindow::minimiseButton)
594 {
595 shape.addLineSegment (Line<float> (0.0f, 0.5f, 1.0f, 0.5f), crossThickness);
596
597 return new LookAndFeel_V3_DocumentWindowButton ("minimise", Colour (0xffaa8811), shape, shape);
598 }
599
600 if (buttonType == DocumentWindow::maximiseButton)
601 {
602 shape.addLineSegment (Line<float> (0.5f, 0.0f, 0.5f, 1.0f), crossThickness);
603 shape.addLineSegment (Line<float> (0.0f, 0.5f, 1.0f, 0.5f), crossThickness);
604
605 Path fullscreenShape;
606 fullscreenShape.startNewSubPath (45.0f, 100.0f);
607 fullscreenShape.lineTo (0.0f, 100.0f);
608 fullscreenShape.lineTo (0.0f, 0.0f);
609 fullscreenShape.lineTo (100.0f, 0.0f);
610 fullscreenShape.lineTo (100.0f, 45.0f);
611 fullscreenShape.addRectangle (45.0f, 45.0f, 100.0f, 100.0f);
612 PathStrokeType (30.0f).createStrokedPath (fullscreenShape, fullscreenShape);
613
614 return new LookAndFeel_V3_DocumentWindowButton ("maximise", Colour (0xff119911), shape, fullscreenShape);
615 }
616
618 return nullptr;
619}
620
622{
623 static const unsigned char pathData[]
624 = { 110,109,32,210,202,64,126,183,148,64,108,39,244,247,64,245,76,124,64,108,178,131,27,65,246,76,252,64,108,175,242,4,65,246,76,252,
625 64,108,236,5,68,65,0,0,160,180,108,240,150,90,65,21,136,52,63,108,48,59,16,65,0,0,32,65,108,32,210,202,64,126,183,148,64, 99,101,0,0 };
626
627 Path p;
628 p.loadPathFromData (pathData, sizeof (pathData));
629 p.scaleToFit (0, 0, height * 2.0f, height, true);
630 return p;
631}
632
634{
635 static const unsigned char pathData[]
636 = { 110,109,88,57,198,65,29,90,171,65,108,63,53,154,65,8,172,126,65,108,76,55,198,65,215,163,38,65,108,141,151,175,65,82,184,242,64,108,117,147,131,65,90,100,81,65,108,184,30,47,65,82,184,242,64,108,59,223,1,65,215,163,38,65,108,84,227,89,65,8,172,126,65,
637 108,35,219,1,65,29,90,171,65,108,209,34,47,65,231,251,193,65,108,117,147,131,65,207,247,149,65,108,129,149,175,65,231,251,193,65,99,101,0,0 };
638
639 Path p;
640 p.loadPathFromData (pathData, sizeof (pathData));
641 p.scaleToFit (0, 0, height * 2.0f, height, true);
642 return p;
643}
644
645} // namespace juce
Type jmin(const Type a, const Type b)
Definition MathsFunctions.h:60
float normal(const fft_t *freqs, off_t x)
Definition OscilGen.cpp:46
Definition juce_AffineTransform.h:43
static AffineTransform translation(float deltaX, float deltaY) noexcept
Definition juce_AffineTransform.cpp:81
Definition juce_AttributedString.h:47
@ backgroundColourId
Definition juce_BubbleComponent.h:142
Definition juce_Button.h:43
bool getToggleState() const noexcept
Definition juce_Button.h:127
Button(const String &buttonName)
Definition juce_Button.cpp:76
Definition juce_ColourGradient.h:38
static ColourGradient horizontal(Colour colour1, float x1, Colour colour2, float x2)
Definition juce_ColourGradient.cpp:90
Point< float > point2
Definition juce_ColourGradient.h:195
static ColourGradient vertical(Colour colour1, float y1, Colour colour2, float y2)
Definition juce_ColourGradient.cpp:85
Point< float > point1
Definition juce_ColourGradient.h:195
Definition juce_Colour.h:38
Colour withAlpha(uint8 newAlpha) const noexcept
Definition juce_Colour.cpp:317
JUCE_NODISCARD Colour brighter(float amountBrighter=0.4f) const noexcept
Definition juce_Colour.cpp:461
JUCE_NODISCARD Colour withMultipliedSaturation(float multiplier) const noexcept
Definition juce_Colour.cpp:432
JUCE_NODISCARD Colour darker(float amountDarker=0.4f) const noexcept
Definition juce_Colour.cpp:472
float getBrightness() const noexcept
Definition juce_Colour.cpp:405
static JUCE_NODISCARD Colour greyLevel(float brightness) noexcept
Definition juce_Colour.cpp:484
Colour withMultipliedAlpha(float alphaMultiplier) const noexcept
Definition juce_Colour.cpp:333
float getFloatAlpha() const noexcept
Definition juce_Colour.cpp:384
JUCE_NODISCARD Colour contrasting(float amount=1.0f) const noexcept
Definition juce_Colour.cpp:491
Colour overlaidWith(Colour foregroundColour) const noexcept
Definition juce_Colour.cpp:343
Definition juce_ComboBox.h:49
@ arrowColourId
Definition juce_ComboBox.h:360
@ outlineColourId
Definition juce_ComboBox.h:358
@ focusedOutlineColourId
Definition juce_ComboBox.h:361
@ buttonColourId
Definition juce_ComboBox.h:359
@ backgroundColourId
Definition juce_ComboBox.h:356
Definition juce_Component.h:36
int getHeight() const noexcept
Definition juce_Component.h:274
bool hasKeyboardFocus(bool trueIfChildIsFocused) const
Definition juce_Component.cpp:3086
TargetClass * findParentComponentOfClass() const
Definition juce_Component.h:813
Colour findColour(int colourID, bool inheritFromParent=false) const
Definition juce_Component.cpp:2219
int getWidth() const noexcept
Definition juce_Component.h:271
bool isEnabled() const noexcept
Definition juce_Component.cpp:3104
Rectangle< int > getLocalBounds() const noexcept
Definition juce_Component.cpp:2283
String getName() const noexcept
Definition juce_Component.h:76
Definition juce_ConcertinaPanel.h:40
@ closeButton
Definition juce_DocumentWindow.h:66
@ maximiseButton
Definition juce_DocumentWindow.h:65
@ minimiseButton
Definition juce_DocumentWindow.h:64
Definition juce_Font.h:42
void setUnderline(bool shouldBeUnderlined)
Definition juce_Font.cpp:723
JUCE_NODISCARD Font boldened() const
Definition juce_Font.cpp:702
Definition juce_GraphicsContext.h:45
@ centred
Definition juce_Justification.h:138
@ centredLeft
Definition juce_Justification.h:143
Definition juce_Line.h:47
int getSliderThumbRadius(Slider &) override
Definition juce_LookAndFeel_V2.cpp:1523
void drawLinearSliderThumb(Graphics &, int x, int y, int width, int height, float sliderPos, float minSliderPos, float maxSliderPos, const Slider::SliderStyle, Slider &) override
Definition juce_LookAndFeel_V2.cpp:1401
Definition juce_LookAndFeel_V3.cpp:536
Path normalShape
Definition juce_LookAndFeel_V3.cpp:575
Colour colour
Definition juce_LookAndFeel_V3.cpp:574
Path toggledShape
Definition juce_LookAndFeel_V3.cpp:575
LookAndFeel_V3_DocumentWindowButton(const String &name, Colour c, const Path &normal, const Path &toggled)
Definition juce_LookAndFeel_V3.cpp:538
void paintButton(Graphics &g, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Definition juce_LookAndFeel_V3.cpp:543
void drawTextEditorOutline(Graphics &, int width, int height, TextEditor &) override
Definition juce_LookAndFeel_V3.cpp:318
void drawButtonBackground(Graphics &, Button &, const Colour &backgroundColour, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Definition juce_LookAndFeel_V3.cpp:126
void drawConcertinaPanelHeader(Graphics &, const Rectangle< int > &area, bool isMouseOver, bool isMouseDown, ConcertinaPanel &, Component &) override
Definition juce_LookAndFeel_V3.cpp:90
void drawTreeviewPlusMinusBox(Graphics &, const Rectangle< float > &area, Colour backgroundColour, bool isOpen, bool isMouseOver) override
Definition juce_LookAndFeel_V3.cpp:335
void drawLinearSlider(Graphics &, int x, int y, int width, int height, float sliderPos, float minSliderPos, float maxSliderPos, const Slider::SliderStyle, Slider &) override
Definition juce_LookAndFeel_V3.cpp:392
void drawMenuBarBackground(Graphics &, int width, int height, bool, MenuBarComponent &) override
Definition juce_LookAndFeel_V3.cpp:478
bool areLinesDrawnForTreeView(TreeView &) override
Definition juce_LookAndFeel_V3.cpp:345
void drawTabAreaBehindFrontButton(TabbedButtonBar &bar, Graphics &g, int w, int h) override
Definition juce_LookAndFeel_V3.cpp:272
bool areScrollbarButtonsVisible() override
Definition juce_LookAndFeel_V3.cpp:51
void drawLinearSliderBackground(Graphics &, int x, int y, int width, int height, float sliderPos, float minSliderPos, float maxSliderPos, const Slider::SliderStyle, Slider &) override
Definition juce_LookAndFeel_V3.cpp:431
void drawTabButton(TabBarButton &, Graphics &, bool isMouseOver, bool isMouseDown) override
Definition juce_LookAndFeel_V3.cpp:191
void drawStretchableLayoutResizerBar(Graphics &, int w, int h, bool isVerticalBar, bool isMouseOver, bool isMouseDragging) override
Definition juce_LookAndFeel_V3.cpp:53
~LookAndFeel_V3() override
Definition juce_LookAndFeel_V3.cpp:49
void drawComboBox(Graphics &, int width, int height, bool isButtonDown, int buttonX, int buttonY, int buttonW, int buttonH, ComboBox &box) override
Definition juce_LookAndFeel_V3.cpp:355
int getTreeViewIndentSize(TreeView &) override
Definition juce_LookAndFeel_V3.cpp:350
int getTabButtonOverlap(int tabDepth) override
Definition juce_LookAndFeel_V3.cpp:175
static void createTabTextLayout(const TabBarButton &button, float length, float depth, Colour colour, TextLayout &)
Definition juce_LookAndFeel_V3.cpp:178
void drawKeymapChangeButton(Graphics &, int width, int height, Button &button, const String &keyDescription) override
Definition juce_LookAndFeel_V3.cpp:493
void drawScrollbar(Graphics &, ScrollBar &, int x, int y, int width, int height, bool isScrollbarVertical, int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown) override
Definition juce_LookAndFeel_V3.cpp:60
int getTabButtonSpaceAroundImage() override
Definition juce_LookAndFeel_V3.cpp:176
LookAndFeel_V3()
Definition juce_LookAndFeel_V3.cpp:29
Button * createDocumentWindowButton(int buttonType) override
Definition juce_LookAndFeel_V3.cpp:580
Path getTickShape(float height) override
Definition juce_LookAndFeel_V3.cpp:621
void drawPopupMenuBackground(Graphics &, int width, int height) override
Definition juce_LookAndFeel_V3.cpp:467
Path getCrossShape(float height) override
Definition juce_LookAndFeel_V3.cpp:633
void drawTableHeaderBackground(Graphics &, TableHeaderComponent &) override
Definition juce_LookAndFeel_V3.cpp:158
bool isColourSpecified(int colourId) const noexcept
Definition juce_LookAndFeel.cpp:100
void setColour(int colourId, Colour colour) noexcept
Definition juce_LookAndFeel.cpp:89
Colour findColour(int colourId) const noexcept
Definition juce_LookAndFeel.cpp:77
Definition juce_MenuBarComponent.h:40
Definition juce_Path.h:65
void addRoundedRectangle(float x, float y, float width, float height, float cornerSize)
Definition juce_Path.cpp:412
void startNewSubPath(float startX, float startY)
Definition juce_Path.cpp:216
void addRectangle(float x, float y, float width, float height)
Definition juce_Path.cpp:323
void lineTo(float endX, float endY)
Definition juce_Path.cpp:233
void addLineSegment(Line< float > line, float lineThickness)
Definition juce_Path.cpp:581
Definition juce_PathStrokeType.h:42
void createStrokedPath(Path &destPath, const Path &sourcePath, const AffineTransform &transform=AffineTransform(), float extraAccuracy=1.0f) const
Definition juce_PathStrokeType.cpp:655
Definition juce_Point.h:42
constexpr Point< float > toFloat() const noexcept
Definition juce_Point.h:234
ValueType y
Definition juce_Point.h:247
ValueType x
Definition juce_Point.h:246
@ backgroundColourId
Definition juce_PopupMenu.h:760
@ textColourId
Definition juce_PopupMenu.h:761
Definition juce_Rectangle.h:67
ValueType getRight() const noexcept
Definition juce_Rectangle.h:139
JUCE_NODISCARD Rectangle withTop(ValueType newTop) const noexcept
Definition juce_Rectangle.h:279
Rectangle removeFromRight(ValueType amountToRemove) noexcept
Definition juce_Rectangle.h:542
Point< ValueType > getBottomLeft() const noexcept
Definition juce_Rectangle.h:176
Point< ValueType > getTopLeft() const noexcept
Definition juce_Rectangle.h:170
ValueType getHeight() const noexcept
Definition juce_Rectangle.h:136
JUCE_NODISCARD Rectangle withHeight(ValueType newHeight) const noexcept
Definition juce_Rectangle.h:248
ValueType getBottom() const noexcept
Definition juce_Rectangle.h:142
ValueType getX() const noexcept
Definition juce_Rectangle.h:127
Point< ValueType > getTopRight() const noexcept
Definition juce_Rectangle.h:173
ValueType getWidth() const noexcept
Definition juce_Rectangle.h:133
Rectangle reduced(ValueType deltaX, ValueType deltaY) const noexcept
Definition juce_Rectangle.h:485
ValueType getY() const noexcept
Definition juce_Rectangle.h:130
Rectangle expanded(ValueType deltaX, ValueType deltaY) const noexcept
Definition juce_Rectangle.h:451
void setBounds(ValueType newX, ValueType newY, ValueType newWidth, ValueType newHeight) noexcept
Definition juce_Rectangle.h:191
Definition juce_ResizableWindow.h:52
Definition juce_ScrollBar.h:54
@ thumbColourId
Definition juce_ScrollBar.h:295
Definition juce_Slider.h:54
SliderStyle
Definition juce_Slider.h:62
@ LinearBarVertical
Definition juce_Slider.h:66
@ LinearBar
Definition juce_Slider.h:65
@ trackColourId
Definition juce_Slider.h:869
@ backgroundColourId
Definition juce_Slider.h:866
@ thumbColourId
Definition juce_Slider.h:867
Definition juce_String.h:53
bool isNotEmpty() const noexcept
Definition juce_String.h:316
Definition juce_TabbedButtonBar.h:44
Definition juce_TabbedButtonBar.h:155
Orientation getOrientation() const noexcept
Definition juce_TabbedButtonBar.h:190
Orientation
Definition juce_TabbedButtonBar.h:162
@ TabsAtLeft
Definition juce_TabbedButtonBar.h:165
@ TabsAtTop
Definition juce_TabbedButtonBar.h:163
@ TabsAtBottom
Definition juce_TabbedButtonBar.h:164
@ TabsAtRight
Definition juce_TabbedButtonBar.h:166
ColourIds
Definition juce_TabbedButtonBar.h:295
@ tabOutlineColourId
Definition juce_TabbedButtonBar.h:296
@ frontTextColourId
Definition juce_TabbedButtonBar.h:300
@ tabTextColourId
Definition juce_TabbedButtonBar.h:297
@ outlineColourId
Definition juce_TabbedComponent.h:189
Definition juce_TableHeaderComponent.h:47
@ backgroundColourId
Definition juce_TableHeaderComponent.h:378
@ outlineColourId
Definition juce_TableHeaderComponent.h:380
int getNumColumns(bool onlyCountVisibleColumns) const
Definition juce_TableHeaderComponent.cpp:70
Rectangle< int > getColumnPosition(int index) const
Definition juce_TableHeaderComponent.cpp:237
@ buttonColourId
Definition juce_TextButton.h:73
@ buttonOnColourId
Definition juce_TextButton.h:76
Definition juce_TextEditor.h:43
@ outlineColourId
Definition juce_TextEditor.h:223
@ focusedOutlineColourId
Definition juce_TextEditor.h:226
bool isReadOnly() const noexcept
Definition juce_TextEditor.cpp:1042
Definition juce_TextLayout.h:41
void draw(Graphics &, Rectangle< float > area) const
Definition juce_TextLayout.cpp:197
void createLayout(const AttributedString &, float maxWidth)
Definition juce_TextLayout.cpp:243
Definition juce_TreeView.h:657
@ selectedItemBackgroundColourId
Definition juce_TreeView.h:873
UINT_D64 w
Definition inflate.c:942
struct huft * t
Definition inflate.c:943
int y
Definition inflate.c:1588
int g
Definition inflate.c:1573
register unsigned i
Definition inflate.c:1575
unsigned s
Definition inflate.c:1555
unsigned x[BMAX+1]
Definition inflate.c:1586
static const char * name
Definition pugl.h:1582
static int int height
Definition pugl.h:1594
static int width
Definition pugl.h:1593
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
#define jassertfalse
static const SerdStyle style
Definition sratom.c:36
const Colour transparentBlack
Definition juce_Colours.h:40
const Colour grey
Definition juce_Colours.h:93
const Colour black
Definition juce_Colours.h:50
const Colour darkgrey
Definition juce_Colours.h:67
const Colour white
Definition juce_Colours.h:180
const Colour yellow
Definition juce_Colours.h:182
Definition carla_juce.cpp:31
static void drawButtonShape(Graphics &g, const Path &outline, Colour baseColour, float height)
Definition juce_LookAndFeel_V3.cpp:109
void ignoreUnused(Types &&...) noexcept
Definition juce_MathsFunctions.h:333
@ slider
Definition juce_AccessibilityRole.h:43
@ menuBar
Definition juce_AccessibilityRole.h:48
@ button
Definition juce_AccessibilityRole.h:38
png_uint_32 length
Definition png.c:2247
Definition jquant2.c:258
static constexpr FloatType pi
Definition juce_MathsFunctions.h:382
uch * p
Definition crypt.c:594
return c
Definition crypt.c:175
int r
Definition crypt.c:458
uch h[RAND_HEAD_LEN]
Definition crypt.c:459