LMMS
Loading...
Searching...
No Matches
juce_LookAndFeel_V2.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
30{
31 static Colour createBaseColour (Colour buttonColour,
32 bool hasKeyboardFocus,
33 bool shouldDrawButtonAsHighlighted,
34 bool shouldDrawButtonAsDown) noexcept
35 {
36 const float sat = hasKeyboardFocus ? 1.3f : 0.9f;
37 const Colour baseColour (buttonColour.withMultipliedSaturation (sat));
38
39 if (shouldDrawButtonAsDown) return baseColour.contrasting (0.2f);
40 if (shouldDrawButtonAsHighlighted) return baseColour.contrasting (0.1f);
41
42 return baseColour;
43 }
44
45 static TextLayout layoutTooltipText (const String& text, Colour colour) noexcept
46 {
47 const float tooltipFontSize = 13.0f;
48 const int maxToolTipWidth = 400;
49
51 s.setJustification (Justification::centred);
52 s.append (text, Font (tooltipFontSize, Font::bold), colour);
53
54 TextLayout tl;
55 tl.createLayoutWithBalancedLineLengths (s, (float) maxToolTipWidth);
56 return tl;
57 }
58}
59
60//==============================================================================
62{
63 // initialise the standard set of colours..
64 const uint32 textButtonColour = 0xffbbbbff;
65 const uint32 textHighlightColour = 0x401111ee;
66 const uint32 standardOutlineColour = 0xb2808080;
67
68 static const uint32 standardColours[] =
69 {
70 TextButton::buttonColourId, textButtonColour,
74
78
80 TextEditor::textColourId, 0xff000000,
81 TextEditor::highlightColourId, textHighlightColour,
84 TextEditor::focusedOutlineColourId, textButtonColour,
86
88
89 Label::backgroundColourId, 0x00000000,
90 Label::textColourId, 0xff000000,
91 Label::outlineColourId, 0x00000000,
92
94 ScrollBar::thumbColourId, 0xffffffff,
95
96 TreeView::linesColourId, 0x4c000000,
100 TreeView::oddItemsColourId, 0x00000000,
101 TreeView::evenItemsColourId, 0x00000000,
102
104 PopupMenu::textColourId, 0xff000000,
108
109 ComboBox::buttonColourId, 0xffbbbbff,
110 ComboBox::outlineColourId, standardOutlineColour,
111 ComboBox::textColourId, 0xff000000,
113 ComboBox::arrowColourId, 0x99000000,
115
118
121 TextPropertyComponent::outlineColourId, standardOutlineColour,
122
124 BooleanPropertyComponent::outlineColourId, standardOutlineColour,
125
126 ListBox::backgroundColourId, 0xffffffff,
127 ListBox::outlineColourId, standardOutlineColour,
128 ListBox::textColourId, 0xff000000,
129
130 Slider::backgroundColourId, 0x00000000,
131 Slider::thumbColourId, textButtonColour,
132 Slider::trackColourId, 0x7fffffff,
135 Slider::textBoxTextColourId, 0xff000000,
137 Slider::textBoxHighlightColourId, textHighlightColour,
138 Slider::textBoxOutlineColourId, standardOutlineColour,
139
141 //DocumentWindow::textColourId, 0xff000000, // (this is deliberately not set)
142
144 AlertWindow::textColourId, 0xff000000,
146
149
151 TooltipWindow::textColourId, 0xff000000,
153
158
159 Toolbar::backgroundColourId, 0xfff6f8f9,
160 Toolbar::separatorColourId, 0x4c000000,
163 Toolbar::labelTextColourId, 0xff000000,
165
170
172
175
178
183
187
188 0x1000440, /*LassoComponent::lassoFillColourId*/ 0x66dddddd,
189 0x1000441, /*LassoComponent::lassoOutlineColourId*/ 0x99111111,
190
191 0x1004000, /*KeyboardComponentBase::upDownButtonBackgroundColourId*/ 0xffd3d3d3,
192 0x1004001, /*KeyboardComponentBase::upDownButtonArrowColourId*/ 0xff000000,
193
194 0x1005000, /*MidiKeyboardComponent::whiteNoteColourId*/ 0xffffffff,
195 0x1005001, /*MidiKeyboardComponent::blackNoteColourId*/ 0xff000000,
196 0x1005002, /*MidiKeyboardComponent::keySeparatorLineColourId*/ 0x66000000,
197 0x1005003, /*MidiKeyboardComponent::mouseOverKeyOverlayColourId*/ 0x80ffff00,
198 0x1005004, /*MidiKeyboardComponent::keyDownOverlayColourId*/ 0xffb6b600,
199 0x1005005, /*MidiKeyboardComponent::textLabelColourId*/ 0xff000000,
200 0x1005006, /*MidiKeyboardComponent::shadowColourId*/ 0x4c000000,
201
202 0x1006000, /*MPEKeyboardComponent::whiteNoteColourId*/ 0xff1a1c27,
203 0x1006001, /*MPEKeyboardComponent::blackNoteColourId*/ 0x99f1f1f1,
204 0x1006002, /*MPEKeyboardComponent::textLabelColourId*/ 0xfff1f1f1,
205 0x1006003, /*MPEKeyboardComponent::noteCircleFillColourId*/ 0x99ba00ff,
206 0x1006004, /*MPEKeyboardComponent::noteCircleOutlineColourId*/ 0xfff1f1f1,
207
208 0x1004500, /*CodeEditorComponent::backgroundColourId*/ 0xffffffff,
209 0x1004502, /*CodeEditorComponent::highlightColourId*/ textHighlightColour,
210 0x1004503, /*CodeEditorComponent::defaultTextColourId*/ 0xff000000,
211 0x1004504, /*CodeEditorComponent::lineNumberBackgroundId*/ 0x44999999,
212 0x1004505, /*CodeEditorComponent::lineNumberTextId*/ 0x44000000,
213
214 0x1007000, /*ColourSelector::backgroundColourId*/ 0xffe5e5e5,
215 0x1007001, /*ColourSelector::labelTextColourId*/ 0xff000000,
216
217 0x100ad00, /*KeyMappingEditorComponent::backgroundColourId*/ 0x00000000,
218 0x100ad01, /*KeyMappingEditorComponent::textColourId*/ 0xff000000,
219
221
223
224 SidePanel::backgroundColour, 0xffffffff,
225 SidePanel::titleTextColour, 0xff000000,
226 SidePanel::shadowBaseColour, 0xff000000,
227 SidePanel::dismissButtonNormalColour, textButtonColour,
228 SidePanel::dismissButtonOverColour, textButtonColour,
230
236 };
237
238 for (int i = 0; i < numElementsInArray (standardColours); i += 2)
239 setColour ((int) standardColours [i], Colour ((uint32) standardColours [i + 1]));
240}
241
243
244//==============================================================================
246 Button& button,
247 const Colour& backgroundColour,
248 bool shouldDrawButtonAsHighlighted,
249 bool shouldDrawButtonAsDown)
250{
251 const int width = button.getWidth();
252 const int height = button.getHeight();
253
254 const float outlineThickness = button.isEnabled() ? ((shouldDrawButtonAsDown || shouldDrawButtonAsHighlighted) ? 1.2f : 0.7f) : 0.4f;
255 const float halfThickness = outlineThickness * 0.5f;
256
257 const float indentL = button.isConnectedOnLeft() ? 0.1f : halfThickness;
258 const float indentR = button.isConnectedOnRight() ? 0.1f : halfThickness;
259 const float indentT = button.isConnectedOnTop() ? 0.1f : halfThickness;
260 const float indentB = button.isConnectedOnBottom() ? 0.1f : halfThickness;
261
262 const Colour baseColour (LookAndFeelHelpers::createBaseColour (backgroundColour,
263 button.hasKeyboardFocus (true),
264 shouldDrawButtonAsHighlighted,
265 shouldDrawButtonAsDown)
266 .withMultipliedAlpha (button.isEnabled() ? 1.0f : 0.5f));
267
269 indentL,
270 indentT,
271 (float) width - indentL - indentR,
272 (float) height - indentT - indentB,
273 baseColour, outlineThickness, -1.0f,
274 button.isConnectedOnLeft(),
275 button.isConnectedOnRight(),
276 button.isConnectedOnTop(),
277 button.isConnectedOnBottom());
278}
279
281{
282 return Font (jmin (15.0f, (float) buttonHeight * 0.6f));
283}
284
286{
287 return getTextButtonFont (b, buttonHeight).getStringWidth (b.getButtonText()) + buttonHeight;
288}
289
291 bool /*shouldDrawButtonAsHighlighted*/, bool /*shouldDrawButtonAsDown*/)
292{
293 Font font (getTextButtonFont (button, button.getHeight()));
294 g.setFont (font);
295 g.setColour (button.findColour (button.getToggleState() ? TextButton::textColourOnId
297 .withMultipliedAlpha (button.isEnabled() ? 1.0f : 0.5f));
298
299 const int yIndent = jmin (4, button.proportionOfHeight (0.3f));
300 const int cornerSize = jmin (button.getHeight(), button.getWidth()) / 2;
301
302 const int fontHeight = roundToInt (font.getHeight() * 0.6f);
303 const int leftIndent = jmin (fontHeight, 2 + cornerSize / (button.isConnectedOnLeft() ? 4 : 2));
304 const int rightIndent = jmin (fontHeight, 2 + cornerSize / (button.isConnectedOnRight() ? 4 : 2));
305 const int textWidth = button.getWidth() - leftIndent - rightIndent;
306
307 if (textWidth > 0)
308 g.drawFittedText (button.getButtonText(),
309 leftIndent, yIndent, textWidth, button.getHeight() - yIndent * 2,
311}
312
314 float x, float y, float w, float h,
315 const bool ticked,
316 const bool isEnabled,
317 const bool shouldDrawButtonAsHighlighted,
318 const bool shouldDrawButtonAsDown)
319{
320 const float boxSize = w * 0.7f;
321
322 drawGlassSphere (g, x, y + (h - boxSize) * 0.5f, boxSize,
324 .withMultipliedAlpha (isEnabled ? 1.0f : 0.5f),
325 true, shouldDrawButtonAsHighlighted, shouldDrawButtonAsDown),
326 isEnabled ? ((shouldDrawButtonAsDown || shouldDrawButtonAsHighlighted) ? 1.1f : 0.5f) : 0.3f);
327
328 if (ticked)
329 {
330 Path tick;
331 tick.startNewSubPath (1.5f, 3.0f);
332 tick.lineTo (3.0f, 6.0f);
333 tick.lineTo (6.0f, 0.0f);
334
335 g.setColour (component.findColour (isEnabled ? ToggleButton::tickColourId
337
338 const AffineTransform trans (AffineTransform::scale (w / 9.0f, h / 9.0f)
339 .translated (x, y));
340
341 g.strokePath (tick, PathStrokeType (2.5f), trans);
342 }
343}
344
346 bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown)
347{
348 if (button.hasKeyboardFocus (true))
349 {
350 g.setColour (button.findColour (TextEditor::focusedOutlineColourId));
351 g.drawRect (0, 0, button.getWidth(), button.getHeight());
352 }
353
354 float fontSize = jmin (15.0f, (float) button.getHeight() * 0.75f);
355 const float tickWidth = fontSize * 1.1f;
356
357 drawTickBox (g, button, 4.0f, ((float) button.getHeight() - tickWidth) * 0.5f,
358 tickWidth, tickWidth,
359 button.getToggleState(),
360 button.isEnabled(),
361 shouldDrawButtonAsHighlighted,
362 shouldDrawButtonAsDown);
363
364 g.setColour (button.findColour (ToggleButton::textColourId));
365 g.setFont (fontSize);
366
367 if (! button.isEnabled())
368 g.setOpacity (0.5f);
369
370 g.drawFittedText (button.getButtonText(),
371 button.getLocalBounds().withTrimmedLeft (roundToInt (tickWidth) + 5)
372 .withTrimmedRight (2),
374}
375
377{
378 auto fontSize = jmin (15.0f, (float) button.getHeight() * 0.75f);
379 auto tickWidth = fontSize * 1.1f;
380
381 Font font (fontSize);
382
383 button.setSize (font.getStringWidth (button.getButtonText()) + roundToInt (tickWidth) + 9,
384 button.getHeight());
385}
386
388 bool /*shouldDrawButtonAsHighlighted*/, bool /*shouldDrawButtonAsDown*/)
389{
390 bool toggleState = button.getToggleState();
391
392 g.fillAll (button.findColour (toggleState ? DrawableButton::backgroundOnColourId
394
395 const int textH = (button.getStyle() == DrawableButton::ImageAboveTextLabel)
396 ? jmin (16, button.proportionOfHeight (0.25f))
397 : 0;
398
399 if (textH > 0)
400 {
401 g.setFont ((float) textH);
402
403 g.setColour (button.findColour (toggleState ? DrawableButton::textColourOnId
405 .withMultipliedAlpha (button.isEnabled() ? 1.0f : 0.4f));
406
407 g.drawFittedText (button.getButtonText(),
408 2, button.getHeight() - textH - 1,
409 button.getWidth() - 4, textH,
411 }
412}
413
414//==============================================================================
416 const String& button1, const String& button2, const String& button3,
417 MessageBoxIconType iconType,
418 int numButtons, Component* associatedComponent)
419{
420 AlertWindow* aw = new AlertWindow (title, message, iconType, associatedComponent);
421
422 if (numButtons == 1)
423 {
424 aw->addButton (button1, 0,
427 }
428 else
429 {
430 const KeyPress button1ShortCut ((int) CharacterFunctions::toLowerCase (button1[0]), 0, 0);
431 KeyPress button2ShortCut ((int) CharacterFunctions::toLowerCase (button2[0]), 0, 0);
432 if (button1ShortCut == button2ShortCut)
433 button2ShortCut = KeyPress();
434
435 if (numButtons == 2)
436 {
437 aw->addButton (button1, 1, KeyPress (KeyPress::returnKey), button1ShortCut);
438 aw->addButton (button2, 0, KeyPress (KeyPress::escapeKey), button2ShortCut);
439 }
440 else if (numButtons == 3)
441 {
442 aw->addButton (button1, 1, button1ShortCut);
443 aw->addButton (button2, 2, button2ShortCut);
444 aw->addButton (button3, 0, KeyPress (KeyPress::escapeKey));
445 }
446 }
447
448 return aw;
449}
450
452 const Rectangle<int>& textArea, TextLayout& textLayout)
453{
455
456 int iconSpaceUsed = 0;
457
458 const int iconWidth = 80;
459 int iconSize = jmin (iconWidth + 50, alert.getHeight() + 20);
460
461 if (alert.containsAnyExtraComponents() || alert.getNumButtons() > 2)
462 iconSize = jmin (iconSize, textArea.getHeight() + 50);
463
464 const Rectangle<int> iconRect (iconSize / -10, iconSize / -10,
465 iconSize, iconSize);
466
468 {
469 Path icon;
470 uint32 colour;
471 char character;
472
474 {
475 colour = 0x55ff5555;
476 character = '!';
477
478 icon.addTriangle ((float) iconRect.getX() + (float) iconRect.getWidth() * 0.5f, (float) iconRect.getY(),
479 (float) iconRect.getRight(), (float) iconRect.getBottom(),
480 (float) iconRect.getX(), (float) iconRect.getBottom());
481
482 icon = icon.createPathWithRoundedCorners (5.0f);
483 }
484 else
485 {
486 colour = alert.getAlertType() == MessageBoxIconType::InfoIcon ? (uint32) 0x605555ff : (uint32) 0x40b69900;
487 character = alert.getAlertType() == MessageBoxIconType::InfoIcon ? 'i' : '?';
488
489 icon.addEllipse (iconRect.toFloat());
490 }
491
493 ga.addFittedText (Font ((float) iconRect.getHeight() * 0.9f, Font::bold),
494 String::charToString ((juce_wchar) (uint8) character),
495 (float) iconRect.getX(), (float) iconRect.getY(),
496 (float) iconRect.getWidth(), (float) iconRect.getHeight(),
498 ga.createPath (icon);
499
500 icon.setUsingNonZeroWinding (false);
501 g.setColour (Colour (colour));
502 g.fillPath (icon);
503
504 iconSpaceUsed = iconWidth;
505 }
506
507 g.setColour (alert.findColour (AlertWindow::textColourId));
508
509 textLayout.draw (g, Rectangle<int> (textArea.getX() + iconSpaceUsed,
510 textArea.getY(),
511 textArea.getWidth() - iconSpaceUsed,
512 textArea.getHeight()).toFloat());
513
514 g.setColour (alert.findColour (AlertWindow::outlineColourId));
515 g.drawRect (0, 0, alert.getWidth(), alert.getHeight());
516}
517
523
525{
526 const int n = buttons.size();
527 Array<int> buttonWidths;
528
529 const int buttonHeight = getAlertWindowButtonHeight();
530
531 for (int i = 0; i < n; ++i)
532 buttonWidths.add (getTextButtonWidthToFitText (*buttons.getReference (i), buttonHeight));
533
534 return buttonWidths;
535}
536
538{
539 return 28;
540}
541
543{
544 Font messageFont = getAlertWindowMessageFont();
545 return messageFont.withHeight (messageFont.getHeight() * 1.1f).boldened();
546}
547
552
554{
555 return Font (12.0f);
556}
557
558//==============================================================================
560 int width, int height,
561 double progress, const String& textToShow)
562{
563 const Colour background (progressBar.findColour (ProgressBar::backgroundColourId));
564 const Colour foreground (progressBar.findColour (ProgressBar::foregroundColourId));
565
566 g.fillAll (background);
567
568 if (progress >= 0.0f && progress < 1.0f)
569 {
570 drawGlassLozenge (g, 1.0f, 1.0f,
571 (float) jlimit (0.0, width - 2.0, progress * (width - 2.0)),
572 (float) (height - 2),
573 foreground,
574 0.5f, 0.0f,
575 true, true, true, true);
576 }
577 else
578 {
579 // spinning bar..
580 g.setColour (foreground);
581
582 const int stripeWidth = height * 2;
583 const int position = (int) (Time::getMillisecondCounter() / 15) % stripeWidth;
584
585 Path p;
586
587 for (float x = (float) (- position); x < (float) (width + stripeWidth); x += (float) stripeWidth)
588 p.addQuadrilateral (x, 0.0f,
589 x + (float) stripeWidth * 0.5f, 0.0f,
590 x, (float) height,
591 x - (float) stripeWidth * 0.5f, (float) height);
592
593 Image im (Image::ARGB, width, height, true);
594
595 {
596 Graphics g2 (im);
597 drawGlassLozenge (g2, 1.0f, 1.0f,
598 (float) (width - 2),
599 (float) (height - 2),
600 foreground,
601 0.5f, 0.0f,
602 true, true, true, true);
603 }
604
605 g.setTiledImageFill (im, 0, 0, 0.85f);
606 g.fillPath (p);
607 }
608
609 if (textToShow.isNotEmpty())
610 {
611 g.setColour (Colour::contrasting (background, foreground));
612 g.setFont ((float) height * 0.6f);
613
614 g.drawText (textToShow, 0, 0, width, height, Justification::centred, false);
615 }
616}
617
618void LookAndFeel_V2::drawSpinningWaitAnimation (Graphics& g, const Colour& colour, int x, int y, int w, int h)
619{
620 const float radius = (float) jmin (w, h) * 0.4f;
621 const float thickness = radius * 0.15f;
622 Path p;
623 p.addRoundedRectangle (radius * 0.4f, thickness * -0.5f,
624 radius * 0.6f, thickness,
625 thickness * 0.5f);
626
627 const float cx = (float) x + (float) w * 0.5f;
628 const float cy = (float) y + (float) h * 0.5f;
629
630 const uint32 animationIndex = (Time::getMillisecondCounter() / (1000 / 10)) % 12;
631
632 for (uint32 i = 0; i < 12; ++i)
633 {
634 const uint32 n = (i + 12 - animationIndex) % 12;
635
636 g.setColour (colour.withMultipliedAlpha ((float) (n + 1) / 12.0f));
637 g.fillPath (p, AffineTransform::rotation ((float) i * (MathConstants<float>::pi / 6.0f))
638 .translated (cx, cy));
639 }
640}
641
643{
644 return progressBar.findColour (ProgressBar::backgroundColourId).isOpaque();
645}
646
648{
649 return true;
650}
651
653 int width, int height, int buttonDirection,
654 bool /*isScrollbarVertical*/,
655 bool /*shouldDrawButtonAsHighlighted*/,
656 bool shouldDrawButtonAsDown)
657{
658 Path p;
659
660 const auto w = (float) width;
661 const auto h = (float) height;
662
663 if (buttonDirection == 0)
664 p.addTriangle (w * 0.5f, h * 0.2f,
665 w * 0.1f, h * 0.7f,
666 w * 0.9f, h * 0.7f);
667 else if (buttonDirection == 1)
668 p.addTriangle (w * 0.8f, h * 0.5f,
669 w * 0.3f, h * 0.1f,
670 w * 0.3f, h * 0.9f);
671 else if (buttonDirection == 2)
672 p.addTriangle (w * 0.5f, h * 0.8f,
673 w * 0.1f, h * 0.3f,
674 w * 0.9f, h * 0.3f);
675 else if (buttonDirection == 3)
676 p.addTriangle (w * 0.2f, h * 0.5f,
677 w * 0.7f, h * 0.1f,
678 w * 0.7f, h * 0.9f);
679
680 if (shouldDrawButtonAsDown)
681 g.setColour (scrollbar.findColour (ScrollBar::thumbColourId).contrasting (0.2f));
682 else
683 g.setColour (scrollbar.findColour (ScrollBar::thumbColourId));
684
685 g.fillPath (p);
686
687 g.setColour (Colour (0x80000000));
688 g.strokePath (p, PathStrokeType (0.5f));
689}
690
692 ScrollBar& scrollbar,
693 int x, int y,
694 int width, int height,
695 bool isScrollbarVertical,
696 int thumbStartPosition,
697 int thumbSize,
698 bool /*isMouseOver*/,
699 bool /*isMouseDown*/)
700{
701 g.fillAll (scrollbar.findColour (ScrollBar::backgroundColourId));
702
703 Path slotPath, thumbPath;
704
705 const float slotIndent = jmin (width, height) > 15 ? 1.0f : 0.0f;
706 const float slotIndentx2 = slotIndent * 2.0f;
707 const float thumbIndent = slotIndent + 1.0f;
708 const float thumbIndentx2 = thumbIndent * 2.0f;
709
710 float gx1 = 0.0f, gy1 = 0.0f, gx2 = 0.0f, gy2 = 0.0f;
711
712 if (isScrollbarVertical)
713 {
714 slotPath.addRoundedRectangle ((float) x + slotIndent,
715 (float) y + slotIndent,
716 (float) width - slotIndentx2,
717 (float) height - slotIndentx2,
718 ((float) width - slotIndentx2) * 0.5f);
719
720 if (thumbSize > 0)
721 thumbPath.addRoundedRectangle ((float) x + thumbIndent,
722 (float) thumbStartPosition + thumbIndent,
723 (float) width - thumbIndentx2,
724 (float) thumbSize - thumbIndentx2,
725 ((float) width - thumbIndentx2) * 0.5f);
726 gx1 = (float) x;
727 gx2 = (float) x + (float) width * 0.7f;
728 }
729 else
730 {
731 slotPath.addRoundedRectangle ((float) x + slotIndent,
732 (float) y + slotIndent,
733 (float) width - slotIndentx2,
734 (float) height - slotIndentx2,
735 ((float) height - slotIndentx2) * 0.5f);
736
737 if (thumbSize > 0)
738 thumbPath.addRoundedRectangle ((float) thumbStartPosition + thumbIndent,
739 (float) y + thumbIndent,
740 (float) thumbSize - thumbIndentx2,
741 (float) height - thumbIndentx2,
742 ((float) height - thumbIndentx2) * 0.5f);
743 gy1 = (float) y;
744 gy2 = (float) y + (float) height * 0.7f;
745 }
746
747 const Colour thumbColour (scrollbar.findColour (ScrollBar::thumbColourId));
748 Colour trackColour1, trackColour2;
749
752 {
753 trackColour1 = trackColour2 = scrollbar.findColour (ScrollBar::trackColourId);
754 }
755 else
756 {
757 trackColour1 = thumbColour.overlaidWith (Colour (0x44000000));
758 trackColour2 = thumbColour.overlaidWith (Colour (0x19000000));
759 }
760
761 g.setGradientFill (ColourGradient (trackColour1, gx1, gy1,
762 trackColour2, gx2, gy2, false));
763 g.fillPath (slotPath);
764
765 if (isScrollbarVertical)
766 {
767 gx1 = (float) x + (float) width * 0.6f;
768 gx2 = (float) x + (float) width;
769 }
770 else
771 {
772 gy1 = (float) y + (float) height * 0.6f;
773 gy2 = (float) y + (float) height;
774 }
775
776 g.setGradientFill (ColourGradient (Colours::transparentBlack,gx1, gy1,
777 Colour (0x19000000), gx2, gy2, false));
778 g.fillPath (slotPath);
779
780 g.setColour (thumbColour);
781 g.fillPath (thumbPath);
782
783 g.setGradientFill (ColourGradient (Colour (0x10000000), gx1, gy1,
784 Colours::transparentBlack, gx2, gy2, false));
785
786 {
788
789 if (isScrollbarVertical)
790 g.reduceClipRegion (x + width / 2, y, width, height);
791 else
792 g.reduceClipRegion (x, y + height / 2, width, height);
793
794 g.fillPath (thumbPath);
795 }
796
797 g.setColour (Colour (0x4c000000));
798 g.strokePath (thumbPath, PathStrokeType (0.4f));
799}
800
805
807{
808 return jmin (scrollbar.getWidth(), scrollbar.getHeight()) * 2;
809}
810
812{
813 return 18;
814}
815
817{
818 return 2 + (scrollbar.isVertical() ? scrollbar.getWidth()
819 : scrollbar.getHeight());
820}
821
822//==============================================================================
824 Colour /*backgroundColour*/, bool isOpen, bool /*isMouseOver*/)
825{
826 auto boxSize = roundToInt (jmin (16.0f, area.getWidth(), area.getHeight()) * 0.7f) | 1;
827
828 auto x = ((int) area.getWidth() - boxSize) / 2 + (int) area.getX();
829 auto y = ((int) area.getHeight() - boxSize) / 2 + (int) area.getY();
830
831 Rectangle<float> boxArea ((float) x, (float) y, (float) boxSize, (float) boxSize);
832
833 g.setColour (Colour (0xe5ffffff));
834 g.fillRect (boxArea);
835
836 g.setColour (Colour (0x80000000));
837 g.drawRect (boxArea);
838
839 auto size = (float) boxSize * 0.5f + 1.0f;
840 auto centre = (float) (boxSize / 2);
841
842 g.fillRect ((float) x + ((float) boxSize - size) * 0.5f, (float) y + centre, size, 1.0f);
843
844 if (! isOpen)
845 g.fillRect ((float) x + centre, (float) y + ((float) boxSize - size) * 0.5f, 1.0f, size);
846}
847
849{
850 return true;
851}
852
854{
855 return 24;
856}
857
858//==============================================================================
860 const Point<float>& tip, const Rectangle<float>& body)
861{
862 Path p;
863 p.addBubble (body.reduced (0.5f), body.getUnion (Rectangle<float> (tip.x, tip.y, 1.0f, 1.0f)),
864 tip, 5.0f, jmin (15.0f, body.getWidth() * 0.2f, body.getHeight() * 0.2f));
865
866 g.setColour (comp.findColour (BubbleComponent::backgroundColourId));
867 g.fillPath (p);
868
869 g.setColour (comp.findColour (BubbleComponent::outlineColourId));
870 g.strokePath (p, PathStrokeType (1.0f));
871}
872
873
874//==============================================================================
876{
877 return Font (17.0f);
878}
879
880void LookAndFeel_V2::getIdealPopupMenuItemSize (const String& text, const bool isSeparator,
881 int standardMenuItemHeight, int& idealWidth, int& idealHeight)
882{
883 if (isSeparator)
884 {
885 idealWidth = 50;
886 idealHeight = standardMenuItemHeight > 0 ? standardMenuItemHeight / 2 : 10;
887 }
888 else
889 {
890 Font font (getPopupMenuFont());
891
892 if (standardMenuItemHeight > 0 && font.getHeight() > (float) standardMenuItemHeight / 1.3f)
893 font.setHeight ((float) standardMenuItemHeight / 1.3f);
894
895 idealHeight = standardMenuItemHeight > 0 ? standardMenuItemHeight : roundToInt (font.getHeight() * 1.3f);
896 idealWidth = font.getStringWidth (text) + idealHeight * 2;
897 }
898}
899
901 bool isSeparator,
902 int standardMenuItemHeight,
903 int& idealWidth,
904 int& idealHeight,
905 const PopupMenu::Options&)
906{
908 isSeparator,
909 standardMenuItemHeight,
910 idealWidth,
911 idealHeight);
912}
913
915{
916 auto background = findColour (PopupMenu::backgroundColourId);
917
918 g.fillAll (background);
919 g.setColour (background.overlaidWith (Colour (0x2badd8e6)));
920
921 for (int i = 0; i < height; i += 3)
922 g.fillRect (0, i, width, 1);
923
924 #if ! JUCE_MAC
925 g.setColour (findColour (PopupMenu::textColourId).withAlpha (0.6f));
926 g.drawRect (0, 0, width, height);
927 #endif
928}
929
937
938void LookAndFeel_V2::drawPopupMenuUpDownArrow (Graphics& g, int width, int height, bool isScrollUpArrow)
939{
940 auto background = findColour (PopupMenu::backgroundColourId);
941
942 g.setGradientFill (ColourGradient (background, 0.0f, (float) height * 0.5f,
943 background.withAlpha (0.0f),
944 0.0f, isScrollUpArrow ? ((float) height) : 0.0f,
945 false));
946
947 g.fillRect (1, 1, width - 2, height - 2);
948
949 auto hw = (float) width * 0.5f;
950 auto arrowW = (float) height * 0.3f;
951 auto y1 = (float) height * (isScrollUpArrow ? 0.6f : 0.3f);
952 auto y2 = (float) height * (isScrollUpArrow ? 0.3f : 0.6f);
953
954 Path p;
955 p.addTriangle (hw - arrowW, y1,
956 hw + arrowW, y1,
957 hw, y2);
958
959 g.setColour (findColour (PopupMenu::textColourId).withAlpha (0.5f));
960 g.fillPath (p);
961}
962
964 int width, int height,
965 bool isScrollUpArrow,
966 const PopupMenu::Options&)
967{
968 drawPopupMenuUpDownArrow (g, width, height, isScrollUpArrow);
969}
970
972 const bool isSeparator, const bool isActive,
973 const bool isHighlighted, const bool isTicked,
974 const bool hasSubMenu, const String& text,
975 const String& shortcutKeyText,
976 const Drawable* icon, const Colour* const textColourToUse)
977{
978 if (isSeparator)
979 {
980 auto r = area.reduced (5, 0);
981 r.removeFromTop (r.getHeight() / 2 - 1);
982
983 g.setColour (Colour (0x33000000));
984 g.fillRect (r.removeFromTop (1));
985
986 g.setColour (Colour (0x66ffffff));
987 g.fillRect (r.removeFromTop (1));
988 }
989 else
990 {
991 auto textColour = findColour (PopupMenu::textColourId);
992
993 if (textColourToUse != nullptr)
994 textColour = *textColourToUse;
995
996 auto r = area.reduced (1);
997
998 if (isHighlighted)
999 {
1001 g.fillRect (r);
1002
1004 }
1005 else
1006 {
1007 g.setColour (textColour);
1008 }
1009
1010 if (! isActive)
1011 g.setOpacity (0.3f);
1012
1013 Font font (getPopupMenuFont());
1014
1015 auto maxFontHeight = (float) area.getHeight() / 1.3f;
1016
1017 if (font.getHeight() > maxFontHeight)
1018 font.setHeight (maxFontHeight);
1019
1020 g.setFont (font);
1021
1022 auto iconArea = r.removeFromLeft ((r.getHeight() * 5) / 4).reduced (3).toFloat();
1023
1024 if (icon != nullptr)
1025 {
1027 }
1028 else if (isTicked)
1029 {
1030 auto tick = getTickShape (1.0f);
1031 g.fillPath (tick, tick.getTransformToScaleToFit (iconArea, true));
1032 }
1033
1034 if (hasSubMenu)
1035 {
1036 auto arrowH = 0.6f * getPopupMenuFont().getAscent();
1037
1038 auto x = (float) r.removeFromRight ((int) arrowH).getX();
1039 auto halfH = (float) r.getCentreY();
1040
1041 Path p;
1042 p.addTriangle (x, halfH - arrowH * 0.5f,
1043 x, halfH + arrowH * 0.5f,
1044 x + arrowH * 0.6f, halfH);
1045
1046 g.fillPath (p);
1047 }
1048
1049 r.removeFromRight (3);
1050 g.drawFittedText (text, r, Justification::centredLeft, 1);
1051
1052 if (shortcutKeyText.isNotEmpty())
1053 {
1054 Font f2 (font);
1055 f2.setHeight (f2.getHeight() * 0.75f);
1056 f2.setHorizontalScale (0.95f);
1057 g.setFont (f2);
1058
1059 g.drawText (shortcutKeyText, r, Justification::centredRight, true);
1060 }
1061 }
1062}
1063
1065 bool isHighlighted,
1066 const PopupMenu::Item& item,
1067 const PopupMenu::Options&)
1068{
1069 const auto colour = item.colour != Colour() ? &item.colour : nullptr;
1070 const auto hasSubMenu = item.subMenu != nullptr
1071 && (item.itemID == 0 || item.subMenu->getNumItems() > 0);
1072
1074 area,
1075 item.isSeparator,
1076 item.isEnabled,
1077 isHighlighted,
1078 item.isTicked,
1079 hasSubMenu,
1080 item.text,
1082 item.image.get(),
1083 colour);
1084}
1085
1087 const Rectangle<int>& area,
1088 const String& sectionName)
1089{
1090 g.setFont (getPopupMenuFont().boldened());
1092
1093 g.drawFittedText (sectionName,
1094 area.getX() + 12, area.getY(), area.getWidth() - 16, (int) ((float) area.getHeight() * 0.8f),
1096}
1097
1099 const String& sectionName,
1100 const PopupMenu::Options&)
1101{
1102 drawPopupMenuSectionHeader (g, area, sectionName);
1103}
1104
1105//==============================================================================
1110
1112{
1114 false, false, false);
1115
1116 if (menuBar.isEnabled())
1117 drawShinyButtonShape (g, -4.0f, 0.0f, (float) width + 8.0f, (float) height,
1118 0.0f, baseColour, 0.4f, true, true, true, true);
1119 else
1120 g.fillAll (baseColour);
1121}
1122
1123Font LookAndFeel_V2::getMenuBarFont (MenuBarComponent& menuBar, int /*itemIndex*/, const String& /*itemText*/)
1124{
1125 return Font ((float) menuBar.getHeight() * 0.7f);
1126}
1127
1128int LookAndFeel_V2::getMenuBarItemWidth (MenuBarComponent& menuBar, int itemIndex, const String& itemText)
1129{
1130 return getMenuBarFont (menuBar, itemIndex, itemText)
1131 .getStringWidth (itemText) + menuBar.getHeight();
1132}
1133
1135 int itemIndex, const String& itemText,
1136 bool isMouseOverItem, bool isMenuOpen,
1137 bool /*isMouseOverBar*/, MenuBarComponent& menuBar)
1138{
1139 if (! menuBar.isEnabled())
1140 {
1141 g.setColour (menuBar.findColour (PopupMenu::textColourId)
1142 .withMultipliedAlpha (0.5f));
1143 }
1144 else if (isMenuOpen || isMouseOverItem)
1145 {
1146 g.fillAll (menuBar.findColour (PopupMenu::highlightedBackgroundColourId));
1147 g.setColour (menuBar.findColour (PopupMenu::highlightedTextColourId));
1148 }
1149 else
1150 {
1151 g.setColour (menuBar.findColour (PopupMenu::textColourId));
1152 }
1153
1154 g.setFont (getMenuBarFont (menuBar, itemIndex, itemText));
1155 g.drawFittedText (itemText, 0, 0, width, height, Justification::centred, 1);
1156}
1157
1162
1164
1166
1168
1173
1177
1182
1183//==============================================================================
1184void LookAndFeel_V2::fillTextEditorBackground (Graphics& g, int /*width*/, int /*height*/, TextEditor& textEditor)
1185{
1186 g.fillAll (textEditor.findColour (TextEditor::backgroundColourId));
1187}
1188
1190{
1191 if (textEditor.isEnabled())
1192 {
1193 if (textEditor.hasKeyboardFocus (true) && ! textEditor.isReadOnly())
1194 {
1195 const int border = 2;
1196
1197 g.setColour (textEditor.findColour (TextEditor::focusedOutlineColourId));
1198 g.drawRect (0, 0, width, height, border);
1199
1200 g.setOpacity (1.0f);
1201 auto shadowColour = textEditor.findColour (TextEditor::shadowColourId).withMultipliedAlpha (0.75f);
1202 drawBevel (g, 0, 0, width, height + 2, border + 2, shadowColour, shadowColour);
1203 }
1204 else
1205 {
1206 g.setColour (textEditor.findColour (TextEditor::outlineColourId));
1207 g.drawRect (0, 0, width, height);
1208
1209 g.setOpacity (1.0f);
1210 auto shadowColour = textEditor.findColour (TextEditor::shadowColourId);
1211 drawBevel (g, 0, 0, width, height + 2, 3, shadowColour, shadowColour);
1212 }
1213 }
1214}
1215
1217{
1218 return new CaretComponent (keyFocusOwner);
1219}
1220
1221//==============================================================================
1222void LookAndFeel_V2::drawComboBox (Graphics& g, int width, int height, const bool isMouseButtonDown,
1223 int buttonX, int buttonY, int buttonW, int buttonH, ComboBox& box)
1224{
1225 g.fillAll (box.findColour (ComboBox::backgroundColourId));
1226
1227 if (box.isEnabled() && box.hasKeyboardFocus (false))
1228 {
1229 g.setColour (box.findColour (ComboBox::focusedOutlineColourId));
1230 g.drawRect (0, 0, width, height, 2);
1231 }
1232 else
1233 {
1234 g.setColour (box.findColour (ComboBox::outlineColourId));
1235 g.drawRect (0, 0, width, height);
1236 }
1237
1238 auto outlineThickness = box.isEnabled() ? (isMouseButtonDown ? 1.2f : 0.5f) : 0.3f;
1239
1241 box.hasKeyboardFocus (true),
1242 false, isMouseButtonDown)
1243 .withMultipliedAlpha (box.isEnabled() ? 1.0f : 0.5f);
1244
1246 (float) buttonX + outlineThickness, (float) buttonY + outlineThickness,
1247 (float) buttonW - outlineThickness * 2.0f, (float) buttonH - outlineThickness * 2.0f,
1248 baseColour, outlineThickness, -1.0f,
1249 true, true, true, true);
1250
1251 if (box.isEnabled())
1252 {
1253 const float arrowX = 0.3f;
1254 const float arrowH = 0.2f;
1255
1256 const auto x = (float) buttonX;
1257 const auto y = (float) buttonY;
1258 const auto w = (float) buttonW;
1259 const auto h = (float) buttonH;
1260
1261 Path p;
1262 p.addTriangle (x + w * 0.5f, y + h * (0.45f - arrowH),
1263 x + w * (1.0f - arrowX), y + h * 0.45f,
1264 x + w * arrowX, y + h * 0.45f);
1265
1266 p.addTriangle (x + w * 0.5f, y + h * (0.55f + arrowH),
1267 x + w * (1.0f - arrowX), y + h * 0.55f,
1268 x + w * arrowX, y + h * 0.55f);
1269
1270 g.setColour (box.findColour (ComboBox::arrowColourId));
1271 g.fillPath (p);
1272 }
1273}
1274
1276{
1277 return Font (jmin (15.0f, (float) box.getHeight() * 0.85f));
1278}
1279
1284
1286{
1287 label.setBounds (1, 1,
1288 box.getWidth() + 3 - box.getHeight(),
1289 box.getHeight() - 2);
1290
1291 label.setFont (getComboBoxFont (box));
1292}
1293
1303
1305{
1306 g.setColour (findColour (ComboBox::textColourId).withMultipliedAlpha (0.5f));
1307
1308 auto font = label.getLookAndFeel().getLabelFont (label);
1309
1310 g.setFont (font);
1311
1312 auto textArea = getLabelBorderSize (label).subtractedFrom (label.getLocalBounds());
1313
1314 g.drawFittedText (box.getTextWhenNothingSelected(), textArea, label.getJustificationType(),
1315 jmax (1, (int) ((float) textArea.getHeight() / font.getHeight())),
1316 label.getMinimumHorizontalScale());
1317}
1318
1319//==============================================================================
1321{
1322 return label.getFont();
1323}
1324
1326{
1327 g.fillAll (label.findColour (Label::backgroundColourId));
1328
1329 if (! label.isBeingEdited())
1330 {
1331 auto alpha = label.isEnabled() ? 1.0f : 0.5f;
1332 const Font font (getLabelFont (label));
1333
1334 g.setColour (label.findColour (Label::textColourId).withMultipliedAlpha (alpha));
1335 g.setFont (font);
1336
1337 auto textArea = getLabelBorderSize (label).subtractedFrom (label.getLocalBounds());
1338
1339 g.drawFittedText (label.getText(), textArea, label.getJustificationType(),
1340 jmax (1, (int) ((float) textArea.getHeight() / font.getHeight())),
1341 label.getMinimumHorizontalScale());
1342
1343 g.setColour (label.findColour (Label::outlineColourId).withMultipliedAlpha (alpha));
1344 }
1345 else if (label.isEnabled())
1346 {
1347 g.setColour (label.findColour (Label::outlineColourId));
1348 }
1349
1350 g.drawRect (label.getLocalBounds());
1351}
1352
1354{
1355 return label.getBorderSize();
1356}
1357
1358//==============================================================================
1360 float /*sliderPos*/,
1361 float /*minSliderPos*/,
1362 float /*maxSliderPos*/,
1363 const Slider::SliderStyle /*style*/, Slider& slider)
1364{
1365 auto sliderRadius = (float) (getSliderThumbRadius (slider) - 2);
1366 auto trackColour = slider.findColour (Slider::trackColourId);
1367 auto gradCol1 = trackColour.overlaidWith (Colours::black.withAlpha (slider.isEnabled() ? 0.25f : 0.13f));
1368 auto gradCol2 = trackColour.overlaidWith (Colour (0x14000000));
1369
1370 Path indent;
1371
1372 if (slider.isHorizontal())
1373 {
1374 const float iy = (float) y + (float) height * 0.5f - sliderRadius * 0.5f;
1375 const float ih = sliderRadius;
1376
1377 g.setGradientFill (ColourGradient::vertical (gradCol1, iy, gradCol2, iy + ih));
1378
1379 indent.addRoundedRectangle ((float) x - sliderRadius * 0.5f, iy,
1380 (float) width + sliderRadius, ih,
1381 5.0f);
1382 }
1383 else
1384 {
1385 const float ix = (float) x + (float) width * 0.5f - sliderRadius * 0.5f;
1386 const float iw = sliderRadius;
1387
1388 g.setGradientFill (ColourGradient::horizontal (gradCol1, ix, gradCol2, ix + iw));
1389
1390 indent.addRoundedRectangle (ix, (float) y - sliderRadius * 0.5f,
1391 iw, (float) height + sliderRadius,
1392 5.0f);
1393 }
1394
1395 g.fillPath (indent);
1396
1397 g.setColour (Colour (0x4c000000));
1398 g.strokePath (indent, PathStrokeType (0.5f));
1399}
1400
1402 float sliderPos, float minSliderPos, float maxSliderPos,
1403 const Slider::SliderStyle style, Slider& slider)
1404{
1405 auto sliderRadius = (float) (getSliderThumbRadius (slider) - 2);
1406
1408 slider.hasKeyboardFocus (false) && slider.isEnabled(),
1409 slider.isMouseOverOrDragging() && slider.isEnabled(),
1410 slider.isMouseButtonDown() && slider.isEnabled());
1411
1412 const float outlineThickness = slider.isEnabled() ? 0.8f : 0.3f;
1413
1415 {
1416 float kx, ky;
1417
1419 {
1420 kx = (float) x + (float) width * 0.5f;
1421 ky = sliderPos;
1422 }
1423 else
1424 {
1425 kx = sliderPos;
1426 ky = (float) y + (float) height * 0.5f;
1427 }
1428
1430 kx - sliderRadius,
1431 ky - sliderRadius,
1432 sliderRadius * 2.0f,
1433 knobColour, outlineThickness);
1434 }
1435 else
1436 {
1438 {
1439 drawGlassSphere (g, (float) x + (float) width * 0.5f - sliderRadius,
1440 sliderPos - sliderRadius,
1441 sliderRadius * 2.0f,
1442 knobColour, outlineThickness);
1443 }
1445 {
1446 drawGlassSphere (g,sliderPos - sliderRadius,
1447 (float) y + (float) height * 0.5f - sliderRadius,
1448 sliderRadius * 2.0f,
1449 knobColour, outlineThickness);
1450 }
1451
1453 {
1454 auto sr = jmin (sliderRadius, (float) width * 0.4f);
1455
1456 drawGlassPointer (g, jmax (0.0f, (float) x + (float) width * 0.5f - sliderRadius * 2.0f),
1457 minSliderPos - sliderRadius,
1458 sliderRadius * 2.0f, knobColour, outlineThickness, 1);
1459
1461 jmin ((float) x + (float) width - sliderRadius * 2.0f,
1462 (float) x + (float) width * 0.5f),
1463 maxSliderPos - sr,
1464 sliderRadius * 2.0f,
1465 knobColour,
1466 outlineThickness,
1467 3);
1468 }
1470 {
1471 auto sr = jmin (sliderRadius, (float) height * 0.4f);
1472
1473 drawGlassPointer (g, minSliderPos - sr,
1474 jmax (0.0f, (float) y + (float) height * 0.5f - sliderRadius * 2.0f),
1475 sliderRadius * 2.0f, knobColour, outlineThickness, 2);
1476
1478 maxSliderPos - sliderRadius,
1479 jmin ((float) y + (float) height - sliderRadius * 2.0f,
1480 (float) y + (float) height * 0.5f),
1481 sliderRadius * 2.0f,
1482 knobColour,
1483 outlineThickness,
1484 4);
1485 }
1486 }
1487}
1488
1490 float sliderPos, float minSliderPos, float maxSliderPos,
1491 const Slider::SliderStyle style, Slider& slider)
1492{
1493 g.fillAll (slider.findColour (Slider::backgroundColourId));
1494
1496 {
1497 const bool isMouseOver = slider.isMouseOverOrDragging() && slider.isEnabled();
1498
1500 .withMultipliedSaturation (slider.isEnabled() ? 1.0f : 0.5f),
1501 false, isMouseOver,
1502 isMouseOver || slider.isMouseButtonDown());
1503
1505 (float) x,
1506 style == Slider::LinearBarVertical ? sliderPos
1507 : (float) y,
1509 : (sliderPos - (float) x),
1510 style == Slider::LinearBarVertical ? ((float) height - sliderPos)
1511 : (float) height, 0.0f,
1512 baseColour,
1513 slider.isEnabled() ? 0.9f : 0.3f,
1514 true, true, true, true);
1515 }
1516 else
1517 {
1518 drawLinearSliderBackground (g, x, y, width, height, sliderPos, minSliderPos, maxSliderPos, style, slider);
1519 drawLinearSliderThumb (g, x, y, width, height, sliderPos, minSliderPos, maxSliderPos, style, slider);
1520 }
1521}
1522
1524{
1525 return jmin (7,
1526 slider.getHeight() / 2,
1527 slider.getWidth() / 2) + 2;
1528}
1529
1530void LookAndFeel_V2::drawRotarySlider (Graphics& g, int x, int y, int width, int height, float sliderPos,
1531 const float rotaryStartAngle, const float rotaryEndAngle, Slider& slider)
1532{
1533 const float radius = jmin ((float) width * 0.5f, (float) height * 0.5f) - 2.0f;
1534 const float centreX = (float) x + (float) width * 0.5f;
1535 const float centreY = (float) y + (float) height * 0.5f;
1536 const float rx = centreX - radius;
1537 const float ry = centreY - radius;
1538 const float rw = radius * 2.0f;
1539 const float angle = rotaryStartAngle + sliderPos * (rotaryEndAngle - rotaryStartAngle);
1540 const bool isMouseOver = slider.isMouseOverOrDragging() && slider.isEnabled();
1541
1542 if (radius > 12.0f)
1543 {
1544 if (slider.isEnabled())
1545 g.setColour (slider.findColour (Slider::rotarySliderFillColourId).withAlpha (isMouseOver ? 1.0f : 0.7f));
1546 else
1547 g.setColour (Colour (0x80808080));
1548
1549 const float thickness = 0.7f;
1550
1551 {
1552 Path filledArc;
1553 filledArc.addPieSegment (rx, ry, rw, rw, rotaryStartAngle, angle, thickness);
1554 g.fillPath (filledArc);
1555 }
1556
1557 {
1558 const float innerRadius = radius * 0.2f;
1559 Path p;
1560 p.addTriangle (-innerRadius, 0.0f,
1561 0.0f, -radius * thickness * 1.1f,
1562 innerRadius, 0.0f);
1563
1564 p.addEllipse (-innerRadius, -innerRadius, innerRadius * 2.0f, innerRadius * 2.0f);
1565
1566 g.fillPath (p, AffineTransform::rotation (angle).translated (centreX, centreY));
1567 }
1568
1569 if (slider.isEnabled())
1570 g.setColour (slider.findColour (Slider::rotarySliderOutlineColourId));
1571 else
1572 g.setColour (Colour (0x80808080));
1573
1574 Path outlineArc;
1575 outlineArc.addPieSegment (rx, ry, rw, rw, rotaryStartAngle, rotaryEndAngle, thickness);
1576 outlineArc.closeSubPath();
1577
1578 g.strokePath (outlineArc, PathStrokeType (slider.isEnabled() ? (isMouseOver ? 2.0f : 1.2f) : 0.3f));
1579 }
1580 else
1581 {
1582 if (slider.isEnabled())
1583 g.setColour (slider.findColour (Slider::rotarySliderFillColourId).withAlpha (isMouseOver ? 1.0f : 0.7f));
1584 else
1585 g.setColour (Colour (0x80808080));
1586
1587 Path p;
1588 p.addEllipse (-0.4f * rw, -0.4f * rw, rw * 0.8f, rw * 0.8f);
1589 PathStrokeType (rw * 0.1f).createStrokedPath (p, p);
1590
1591 p.addLineSegment (Line<float> (0.0f, 0.0f, 0.0f, -radius), rw * 0.2f);
1592
1593 g.fillPath (p, AffineTransform::rotation (angle).translated (centreX, centreY));
1594 }
1595}
1596
1598{
1599 return new TextButton (isIncrement ? "+" : "-", String());
1600}
1601
1603{
1604public:
1605 SliderLabelComp() : Label ({}, {}) {}
1606
1607 void mouseWheelMove (const MouseEvent&, const MouseWheelDetails&) override {}
1608
1609 std::unique_ptr<AccessibilityHandler> createAccessibilityHandler() override
1610 {
1611 return createIgnoredAccessibilityHandler (*this);
1612 }
1613};
1614
1616{
1617 auto l = new SliderLabelComp();
1618
1619 l->setJustificationType (Justification::centred);
1620 l->setKeyboardType (TextInputTarget::decimalKeyboard);
1621
1622 l->setColour (Label::textColourId, slider.findColour (Slider::textBoxTextColourId));
1623 l->setColour (Label::backgroundColourId,
1624 (slider.getSliderStyle() == Slider::LinearBar || slider.getSliderStyle() == Slider::LinearBarVertical)
1631 .withAlpha ((slider.getSliderStyle() == Slider::LinearBar || slider.getSliderStyle() == Slider::LinearBarVertical)
1632 ? 0.7f : 1.0f));
1635
1636 return l;
1637}
1638
1640{
1641 return nullptr;
1642}
1643
1645{
1646 return Font (15.0f, Font::bold);
1647}
1648
1656
1657//==============================================================================
1659{
1660 // 1. compute the actually visible textBox size from the slider textBox size and some additional constraints
1661
1662 int minXSpace = 0;
1663 int minYSpace = 0;
1664
1665 auto textBoxPos = slider.getTextBoxPosition();
1666
1667 if (textBoxPos == Slider::TextBoxLeft || textBoxPos == Slider::TextBoxRight)
1668 minXSpace = 30;
1669 else
1670 minYSpace = 15;
1671
1672 auto localBounds = slider.getLocalBounds();
1673
1674 auto textBoxWidth = jmax (0, jmin (slider.getTextBoxWidth(), localBounds.getWidth() - minXSpace));
1675 auto textBoxHeight = jmax (0, jmin (slider.getTextBoxHeight(), localBounds.getHeight() - minYSpace));
1676
1677 Slider::SliderLayout layout;
1678
1679 // 2. set the textBox bounds
1680
1681 if (textBoxPos != Slider::NoTextBox)
1682 {
1683 if (slider.isBar())
1684 {
1685 layout.textBoxBounds = localBounds;
1686 }
1687 else
1688 {
1689 layout.textBoxBounds.setWidth (textBoxWidth);
1690 layout.textBoxBounds.setHeight (textBoxHeight);
1691
1692 if (textBoxPos == Slider::TextBoxLeft) layout.textBoxBounds.setX (0);
1693 else if (textBoxPos == Slider::TextBoxRight) layout.textBoxBounds.setX (localBounds.getWidth() - textBoxWidth);
1694 else /* above or below -> centre horizontally */ layout.textBoxBounds.setX ((localBounds.getWidth() - textBoxWidth) / 2);
1695
1696 if (textBoxPos == Slider::TextBoxAbove) layout.textBoxBounds.setY (0);
1697 else if (textBoxPos == Slider::TextBoxBelow) layout.textBoxBounds.setY (localBounds.getHeight() - textBoxHeight);
1698 else /* left or right -> centre vertically */ layout.textBoxBounds.setY ((localBounds.getHeight() - textBoxHeight) / 2);
1699 }
1700 }
1701
1702 // 3. set the slider bounds
1703
1704 layout.sliderBounds = localBounds;
1705
1706 if (slider.isBar())
1707 {
1708 layout.sliderBounds.reduce (1, 1); // bar border
1709 }
1710 else
1711 {
1712 if (textBoxPos == Slider::TextBoxLeft) layout.sliderBounds.removeFromLeft (textBoxWidth);
1713 else if (textBoxPos == Slider::TextBoxRight) layout.sliderBounds.removeFromRight (textBoxWidth);
1714 else if (textBoxPos == Slider::TextBoxAbove) layout.sliderBounds.removeFromTop (textBoxHeight);
1715 else if (textBoxPos == Slider::TextBoxBelow) layout.sliderBounds.removeFromBottom (textBoxHeight);
1716
1717 const int thumbIndent = getSliderThumbRadius (slider);
1718
1719 if (slider.isHorizontal()) layout.sliderBounds.reduce (thumbIndent, 0);
1720 else if (slider.isVertical()) layout.sliderBounds.reduce (0, thumbIndent);
1721 }
1722
1723 return layout;
1724}
1725
1726//==============================================================================
1728{
1730
1731 auto w = (int) (tl.getWidth() + 14.0f);
1732 auto h = (int) (tl.getHeight() + 6.0f);
1733
1734 return Rectangle<int> (screenPos.x > parentArea.getCentreX() ? screenPos.x - (w + 12) : screenPos.x + 24,
1735 screenPos.y > parentArea.getCentreY() ? screenPos.y - (h + 6) : screenPos.y + 6,
1736 w, h)
1737 .constrainedWithin (parentArea);
1738}
1739
1741{
1743
1744 #if ! JUCE_MAC // The mac windows already have a non-optional 1 pix outline, so don't double it here..
1746 g.drawRect (0, 0, width, height, 1);
1747 #endif
1748
1750 .draw (g, Rectangle<float> ((float) width, (float) height));
1751}
1752
1753//==============================================================================
1755{
1756 return new TextButton (text, TRANS("click to browse for a different file"));
1757}
1758
1760 ComboBox* filenameBox, Button* browseButton)
1761{
1762 if (browseButton == nullptr || filenameBox == nullptr)
1763 return;
1764
1765 browseButton->setSize (80, filenameComp.getHeight());
1766
1767 if (auto* tb = dynamic_cast<TextButton*> (browseButton))
1768 tb->changeWidthToFitText();
1769
1770 browseButton->setTopRightPosition (filenameComp.getWidth(), 0);
1771
1772 filenameBox->setBounds (0, 0, browseButton->getX(), filenameComp.getHeight());
1773}
1774
1775//==============================================================================
1777 bool isMouseOver, bool /*isMouseDown*/,
1778 ConcertinaPanel&, Component& panel)
1779{
1780 g.fillAll (Colours::grey.withAlpha (isMouseOver ? 0.9f : 0.7f));
1781 g.setColour (Colours::black.withAlpha (0.5f));
1782 g.drawRect (area);
1783
1784 g.setColour (Colours::white);
1785 g.setFont (Font ((float) area.getHeight() * 0.7f).boldened());
1786 g.drawFittedText (panel.getName(), 4, 0, area.getWidth() - 6, area.getHeight(), Justification::centredLeft, 1);
1787}
1788
1789//==============================================================================
1791 int imageX, int imageY, int imageW, int imageH,
1792 const Colour& overlayColour,
1793 float imageOpacity,
1794 ImageButton& button)
1795{
1796 if (! button.isEnabled())
1797 imageOpacity *= 0.3f;
1798
1800 .getTransformToFit (image->getBounds().toFloat(),
1801 Rectangle<int> (imageX, imageY, imageW, imageH).toFloat());
1802
1803 if (! overlayColour.isOpaque())
1804 {
1805 g.setOpacity (imageOpacity);
1806 g.drawImageTransformed (*image, t, false);
1807 }
1808
1809 if (! overlayColour.isTransparent())
1810 {
1811 g.setColour (overlayColour);
1812 g.drawImageTransformed (*image, t, true);
1813 }
1814}
1815
1816//==============================================================================
1817void LookAndFeel_V2::drawCornerResizer (Graphics& g, int w, int h, bool /*isMouseOver*/, bool /*isMouseDragging*/)
1818{
1819 auto lineThickness = jmin ((float) w, (float) h) * 0.075f;
1820
1821 for (float i = 0.0f; i < 1.0f; i += 0.3f)
1822 {
1823 g.setColour (Colours::lightgrey);
1824
1825 g.drawLine ((float) w * i,
1826 (float) h + 1.0f,
1827 (float) w + 1.0f,
1828 (float) h * i,
1829 lineThickness);
1830
1831 g.setColour (Colours::darkgrey);
1832
1833 g.drawLine ((float) w * i + lineThickness,
1834 (float) h + 1.0f,
1835 (float) w + 1.0f,
1836 (float) h * i + lineThickness,
1837 lineThickness);
1838 }
1839}
1840
1842{
1843 if (! border.isEmpty())
1844 {
1845 const Rectangle<int> fullSize (0, 0, w, h);
1846 auto centreArea = border.subtractedFrom (fullSize);
1847
1849
1850 g.excludeClipRegion (centreArea);
1851
1852 g.setColour (Colour (0x50000000));
1853 g.drawRect (fullSize);
1854
1855 g.setColour (Colour (0x19000000));
1856 g.drawRect (centreArea.expanded (1, 1));
1857 }
1858}
1859
1860//==============================================================================
1862 const BorderSize<int>& /*border*/, ResizableWindow& window)
1863{
1864 g.fillAll (window.getBackgroundColour());
1865}
1866
1868 const BorderSize<int>& /*border*/, ResizableWindow&)
1869{
1870}
1871
1873 int w, int h, int titleSpaceX, int titleSpaceW,
1874 const Image* icon, bool drawTitleTextOnLeft)
1875{
1876 if (w * h == 0)
1877 return;
1878
1879 const bool isActive = window.isActiveWindow();
1880
1881 g.setGradientFill (ColourGradient::vertical (window.getBackgroundColour(), 0,
1882 window.getBackgroundColour().contrasting (isActive ? 0.15f : 0.05f), (float) h));
1883 g.fillAll();
1884
1885 Font font ((float) h * 0.65f, Font::bold);
1886 g.setFont (font);
1887
1888 int textW = font.getStringWidth (window.getName());
1889 int iconW = 0;
1890 int iconH = 0;
1891
1892 if (icon != nullptr)
1893 {
1894 iconH = (int) font.getHeight();
1895 iconW = icon->getWidth() * iconH / icon->getHeight() + 4;
1896 }
1897
1898 textW = jmin (titleSpaceW, textW + iconW);
1899 int textX = drawTitleTextOnLeft ? titleSpaceX
1900 : jmax (titleSpaceX, (w - textW) / 2);
1901
1902 if (textX + textW > titleSpaceX + titleSpaceW)
1903 textX = titleSpaceX + titleSpaceW - textW;
1904
1905 if (icon != nullptr)
1906 {
1907 g.setOpacity (isActive ? 1.0f : 0.6f);
1908 g.drawImageWithin (*icon, textX, (h - iconH) / 2, iconW, iconH,
1910 textX += iconW;
1911 textW -= iconW;
1912 }
1913
1915 g.setColour (window.findColour (DocumentWindow::textColourId));
1916 else
1917 g.setColour (window.getBackgroundColour().contrasting (isActive ? 0.7f : 0.4f));
1918
1919 g.drawText (window.getName(), textX, 0, textW, h, Justification::centredLeft, true);
1920}
1921
1922//==============================================================================
1924{
1925public:
1927 const Path& normalShape_,
1928 const Path& toggledShape_) noexcept
1929 : Button (name),
1930 colour (col),
1931 normalShape (normalShape_),
1932 toggledShape (toggledShape_)
1933 {
1934 }
1935
1936 //==============================================================================
1937 void paintButton (Graphics& g, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
1938 {
1939 float alpha = shouldDrawButtonAsHighlighted ? (shouldDrawButtonAsDown ? 1.0f : 0.8f) : 0.55f;
1940
1941 if (! isEnabled())
1942 alpha *= 0.5f;
1943
1944 float x = 0, y = 0, diam;
1945
1946 if (getWidth() < getHeight())
1947 {
1948 diam = (float) getWidth();
1949 y = (float) (getHeight() - getWidth()) * 0.5f;
1950 }
1951 else
1952 {
1953 diam = (float) getHeight();
1954 y = (float) (getWidth() - getHeight()) * 0.5f;
1955 }
1956
1957 x += diam * 0.05f;
1958 y += diam * 0.05f;
1959 diam *= 0.9f;
1960
1961 g.setGradientFill (ColourGradient (Colour::greyLevel (0.9f).withAlpha (alpha), 0, y + diam,
1962 Colour::greyLevel (0.6f).withAlpha (alpha), 0, y, false));
1963 g.fillEllipse (x, y, diam, diam);
1964
1965 x += 2.0f;
1966 y += 2.0f;
1967 diam -= 4.0f;
1968
1969 LookAndFeel_V2::drawGlassSphere (g, x, y, diam, colour.withAlpha (alpha), 1.0f);
1970
1972
1973 const AffineTransform t (p.getTransformToScaleToFit (x + diam * 0.3f, y + diam * 0.3f,
1974 diam * 0.4f, diam * 0.4f, true));
1975
1976 g.setColour (Colours::black.withAlpha (alpha * 0.6f));
1977 g.fillPath (p, t);
1978 }
1979
1980private:
1983
1985};
1986
1988{
1989 Path shape;
1990 const float crossThickness = 0.25f;
1991
1992 if (buttonType == DocumentWindow::closeButton)
1993 {
1994 shape.addLineSegment (Line<float> (0.0f, 0.0f, 1.0f, 1.0f), crossThickness * 1.4f);
1995 shape.addLineSegment (Line<float> (1.0f, 0.0f, 0.0f, 1.0f), crossThickness * 1.4f);
1996
1997 return new GlassWindowButton ("close", Colour (0xffdd1100), shape, shape);
1998 }
1999
2000 if (buttonType == DocumentWindow::minimiseButton)
2001 {
2002 shape.addLineSegment (Line<float> (0.0f, 0.5f, 1.0f, 0.5f), crossThickness);
2003
2004 return new GlassWindowButton ("minimise", Colour (0xffaa8811), shape, shape);
2005 }
2006
2007 if (buttonType == DocumentWindow::maximiseButton)
2008 {
2009 shape.addLineSegment (Line<float> (0.5f, 0.0f, 0.5f, 1.0f), crossThickness);
2010 shape.addLineSegment (Line<float> (0.0f, 0.5f, 1.0f, 0.5f), crossThickness);
2011
2012 Path fullscreenShape;
2013 fullscreenShape.startNewSubPath (45.0f, 100.0f);
2014 fullscreenShape.lineTo (0.0f, 100.0f);
2015 fullscreenShape.lineTo (0.0f, 0.0f);
2016 fullscreenShape.lineTo (100.0f, 0.0f);
2017 fullscreenShape.lineTo (100.0f, 45.0f);
2018 fullscreenShape.addRectangle (45.0f, 45.0f, 100.0f, 100.0f);
2019 PathStrokeType (30.0f).createStrokedPath (fullscreenShape, fullscreenShape);
2020
2021 return new GlassWindowButton ("maximise", Colour (0xff119911), shape, fullscreenShape);
2022 }
2023
2025 return nullptr;
2026}
2027
2029 int titleBarX, int titleBarY,
2030 int titleBarW, int titleBarH,
2031 Button* minimiseButton,
2032 Button* maximiseButton,
2033 Button* closeButton,
2034 bool positionTitleBarButtonsOnLeft)
2035{
2036 const int buttonW = titleBarH - titleBarH / 8;
2037
2038 int x = positionTitleBarButtonsOnLeft ? titleBarX + 4
2039 : titleBarX + titleBarW - buttonW - buttonW / 4;
2040
2041 if (closeButton != nullptr)
2042 {
2043 closeButton->setBounds (x, titleBarY, buttonW, titleBarH);
2044 x += positionTitleBarButtonsOnLeft ? buttonW : -(buttonW + buttonW / 4);
2045 }
2046
2047 if (positionTitleBarButtonsOnLeft)
2048 std::swap (minimiseButton, maximiseButton);
2049
2050 if (maximiseButton != nullptr)
2051 {
2052 maximiseButton->setBounds (x, titleBarY, buttonW, titleBarH);
2053 x += positionTitleBarButtonsOnLeft ? buttonW : -buttonW;
2054 }
2055
2056 if (minimiseButton != nullptr)
2057 minimiseButton->setBounds (x, titleBarY, buttonW, titleBarH);
2058}
2059
2061{
2062 return 24;
2063}
2064
2065//==============================================================================
2067{
2068 return std::make_unique<DropShadower> (DropShadow (Colours::black.withAlpha (0.4f), 10, Point<int> (0, 2)));
2069}
2070
2072{
2073 struct WindowProperties : public FocusOutline::OutlineWindowProperties
2074 {
2075 Rectangle<int> getOutlineBounds (Component& c) override
2076 {
2077 return c.getScreenBounds();
2078 }
2079
2080 void drawOutline (Graphics& g, int width, int height) override
2081 {
2082 g.setColour (Colours::yellow.withAlpha (0.6f));
2083 g.drawRoundedRectangle ({ (float) width, (float) height }, 3.0f, 3.0f);
2084 }
2085 };
2086
2087 return std::make_unique<FocusOutline> (std::make_unique<WindowProperties>());
2088}
2089
2090//==============================================================================
2092 bool /*isVerticalBar*/,
2093 bool isMouseOver,
2094 bool isMouseDragging)
2095{
2096 auto alpha = 0.5f;
2097
2098 if (isMouseOver || isMouseDragging)
2099 {
2100 g.fillAll (Colour (0x190000ff));
2101 alpha = 1.0f;
2102 }
2103
2104 auto cx = (float) w * 0.5f;
2105 auto cy = (float) h * 0.5f;
2106 auto cr = (float) jmin (w, h) * 0.4f;
2107
2108 g.setGradientFill (ColourGradient (Colours::white.withAlpha (alpha), cx + cr * 0.1f, cy + cr,
2109 Colours::black.withAlpha (alpha), cx, cy - cr * 4.0f,
2110 true));
2111
2112 g.fillEllipse (cx - cr, cy - cr, cr * 2.0f, cr * 2.0f);
2113}
2114
2115//==============================================================================
2117 const String& text, const Justification& position,
2118 GroupComponent& group)
2119{
2120 const float textH = 15.0f;
2121 const float indent = 3.0f;
2122 const float textEdgeGap = 4.0f;
2123 auto cs = 5.0f;
2124
2125 Font f (textH);
2126
2127 Path p;
2128 auto x = indent;
2129 auto y = f.getAscent() - 3.0f;
2130 auto w = jmax (0.0f, (float) width - x * 2.0f);
2131 auto h = jmax (0.0f, (float) height - y - indent);
2132 cs = jmin (cs, w * 0.5f, h * 0.5f);
2133 auto cs2 = 2.0f * cs;
2134
2135 auto textW = text.isEmpty() ? 0
2136 : jlimit (0.0f,
2137 jmax (0.0f, w - cs2 - textEdgeGap * 2),
2138 (float) f.getStringWidth (text) + textEdgeGap * 2.0f);
2139 auto textX = cs + textEdgeGap;
2140
2141 if (position.testFlags (Justification::horizontallyCentred))
2142 textX = cs + (w - cs2 - textW) * 0.5f;
2143 else if (position.testFlags (Justification::right))
2144 textX = w - cs - textW - textEdgeGap;
2145
2146 p.startNewSubPath (x + textX + textW, y);
2147 p.lineTo (x + w - cs, y);
2148
2149 p.addArc (x + w - cs2, y, cs2, cs2, 0, MathConstants<float>::halfPi);
2150 p.lineTo (x + w, y + h - cs);
2151
2152 p.addArc (x + w - cs2, y + h - cs2, cs2, cs2, MathConstants<float>::halfPi, MathConstants<float>::pi);
2153 p.lineTo (x + cs, y + h);
2154
2155 p.addArc (x, y + h - cs2, cs2, cs2, MathConstants<float>::pi, MathConstants<float>::pi * 1.5f);
2156 p.lineTo (x, y + cs);
2157
2158 p.addArc (x, y, cs2, cs2, MathConstants<float>::pi * 1.5f, MathConstants<float>::twoPi);
2159 p.lineTo (x + textX, y);
2160
2161 auto alpha = group.isEnabled() ? 1.0f : 0.5f;
2162
2163 g.setColour (group.findColour (GroupComponent::outlineColourId)
2164 .withMultipliedAlpha (alpha));
2165
2166 g.strokePath (p, PathStrokeType (2.0f));
2167
2168 g.setColour (group.findColour (GroupComponent::textColourId)
2169 .withMultipliedAlpha (alpha));
2170 g.setFont (f);
2171 g.drawText (text,
2172 roundToInt (x + textX), 0,
2173 roundToInt (textW),
2174 roundToInt (textH),
2176}
2177
2178//==============================================================================
2180{
2181 return 1 + tabDepth / 3;
2182}
2183
2185{
2186 return 4;
2187}
2188
2190{
2191 int width = Font ((float) tabDepth * 0.6f).getStringWidth (button.getButtonText().trim())
2192 + getTabButtonOverlap (tabDepth) * 2;
2193
2194 if (auto* extraComponent = button.getExtraComponent())
2195 width += button.getTabbedButtonBar().isVertical() ? extraComponent->getHeight()
2196 : extraComponent->getWidth();
2197
2198 return jlimit (tabDepth * 2, tabDepth * 8, width);
2199}
2200
2202{
2203 Rectangle<int> extraComp;
2204
2205 auto orientation = button.getTabbedButtonBar().getOrientation();
2206
2207 if (button.getExtraComponentPlacement() == TabBarButton::beforeText)
2208 {
2209 switch (orientation)
2210 {
2212 case TabbedButtonBar::TabsAtTop: extraComp = textArea.removeFromLeft (comp.getWidth()); break;
2213 case TabbedButtonBar::TabsAtLeft: extraComp = textArea.removeFromBottom (comp.getHeight()); break;
2214 case TabbedButtonBar::TabsAtRight: extraComp = textArea.removeFromTop (comp.getHeight()); break;
2215 default: jassertfalse; break;
2216 }
2217 }
2218 else
2219 {
2220 switch (orientation)
2221 {
2223 case TabbedButtonBar::TabsAtTop: extraComp = textArea.removeFromRight (comp.getWidth()); break;
2224 case TabbedButtonBar::TabsAtLeft: extraComp = textArea.removeFromTop (comp.getHeight()); break;
2225 case TabbedButtonBar::TabsAtRight: extraComp = textArea.removeFromBottom (comp.getHeight()); break;
2226 default: jassertfalse; break;
2227 }
2228 }
2229
2230 return extraComp;
2231}
2232
2233void LookAndFeel_V2::createTabButtonShape (TabBarButton& button, Path& p, bool /*isMouseOver*/, bool /*isMouseDown*/)
2234{
2235 auto activeArea = button.getActiveArea();
2236 auto w = (float) activeArea.getWidth();
2237 auto h = (float) activeArea.getHeight();
2238
2239 auto length = w;
2240 auto depth = h;
2241
2242 if (button.getTabbedButtonBar().isVertical())
2243 std::swap (length, depth);
2244
2245 const float indent = (float) getTabButtonOverlap ((int) depth);
2246 const float overhang = 4.0f;
2247
2248 switch (button.getTabbedButtonBar().getOrientation())
2249 {
2251 p.startNewSubPath (w, 0.0f);
2252 p.lineTo (0.0f, indent);
2253 p.lineTo (0.0f, h - indent);
2254 p.lineTo (w, h);
2255 p.lineTo (w + overhang, h + overhang);
2256 p.lineTo (w + overhang, -overhang);
2257 break;
2258
2260 p.startNewSubPath (0.0f, 0.0f);
2261 p.lineTo (w, indent);
2262 p.lineTo (w, h - indent);
2263 p.lineTo (0.0f, h);
2264 p.lineTo (-overhang, h + overhang);
2265 p.lineTo (-overhang, -overhang);
2266 break;
2267
2269 p.startNewSubPath (0.0f, 0.0f);
2270 p.lineTo (indent, h);
2271 p.lineTo (w - indent, h);
2272 p.lineTo (w, 0.0f);
2273 p.lineTo (w + overhang, -overhang);
2274 p.lineTo (-overhang, -overhang);
2275 break;
2276
2278 default:
2279 p.startNewSubPath (0.0f, h);
2280 p.lineTo (indent, 0.0f);
2281 p.lineTo (w - indent, 0.0f);
2282 p.lineTo (w, h);
2283 p.lineTo (w + overhang, h + overhang);
2284 p.lineTo (-overhang, h + overhang);
2285 break;
2286 }
2287
2288 p.closeSubPath();
2289
2290 p = p.createPathWithRoundedCorners (3.0f);
2291}
2292
2294 bool /*isMouseOver*/, bool /*isMouseDown*/)
2295{
2296 auto tabBackground = button.getTabBackgroundColour();
2297 const bool isFrontTab = button.isFrontTab();
2298
2299 g.setColour (isFrontTab ? tabBackground
2300 : tabBackground.withMultipliedAlpha (0.9f));
2301
2302 g.fillPath (path);
2303
2304 g.setColour (button.findColour (isFrontTab ? TabbedButtonBar::frontOutlineColourId
2306 .withMultipliedAlpha (button.isEnabled() ? 1.0f : 0.5f));
2307
2308 g.strokePath (path, PathStrokeType (isFrontTab ? 1.0f : 0.5f));
2309}
2310
2312{
2313 return { height * 0.6f };
2314}
2315
2316void LookAndFeel_V2::drawTabButtonText (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown)
2317{
2318 auto area = button.getTextArea().toFloat();
2319
2320 auto length = area.getWidth();
2321 auto depth = area.getHeight();
2322
2323 if (button.getTabbedButtonBar().isVertical())
2324 std::swap (length, depth);
2325
2326 Font font (getTabButtonFont (button, depth));
2327 font.setUnderline (button.hasKeyboardFocus (false));
2328
2330
2331 switch (button.getTabbedButtonBar().getOrientation())
2332 {
2333 case TabbedButtonBar::TabsAtLeft: t = t.rotated (MathConstants<float>::pi * -0.5f).translated (area.getX(), area.getBottom()); break;
2334 case TabbedButtonBar::TabsAtRight: t = t.rotated (MathConstants<float>::pi * 0.5f).translated (area.getRight(), area.getY()); break;
2336 case TabbedButtonBar::TabsAtBottom: t = t.translated (area.getX(), area.getY()); break;
2337 default: jassertfalse; break;
2338 }
2339
2340 Colour col;
2341
2342 if (button.isFrontTab() && (button.isColourSpecified (TabbedButtonBar::frontTextColourId)
2345 else if (button.isColourSpecified (TabbedButtonBar::tabTextColourId)
2348 else
2349 col = button.getTabBackgroundColour().contrasting();
2350
2351 auto alpha = button.isEnabled() ? ((isMouseOver || isMouseDown) ? 1.0f : 0.8f) : 0.3f;
2352
2353 g.setColour (col.withMultipliedAlpha (alpha));
2354 g.setFont (font);
2355 g.addTransform (t);
2356
2357 g.drawFittedText (button.getButtonText().trim(),
2358 0, 0, (int) length, (int) depth,
2360 jmax (1, ((int) depth) / 12));
2361}
2362
2363void LookAndFeel_V2::drawTabButton (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown)
2364{
2365 Path tabShape;
2366 createTabButtonShape (button, tabShape, isMouseOver, isMouseDown);
2367
2368 auto activeArea = button.getActiveArea();
2369 tabShape.applyTransform (AffineTransform::translation ((float) activeArea.getX(),
2370 (float) activeArea.getY()));
2371
2372 DropShadow (Colours::black.withAlpha (0.5f), 2, Point<int> (0, 1)).drawForPath (g, tabShape);
2373
2374 fillTabButtonShape (button, g, tabShape, isMouseOver, isMouseDown);
2375 drawTabButtonText (button, g, isMouseOver, isMouseDown);
2376}
2377
2379
2381{
2382 auto shadowSize = 0.2f;
2383
2384 Rectangle<int> shadowRect, line;
2385 ColourGradient gradient (Colours::black.withAlpha (bar.isEnabled() ? 0.25f : 0.15f), 0, 0,
2386 Colours::transparentBlack, 0, 0, false);
2387
2388 switch (bar.getOrientation())
2389 {
2391 gradient.point1.x = (float) w;
2392 gradient.point2.x = (float) w * (1.0f - shadowSize);
2393 shadowRect.setBounds ((int) gradient.point2.x, 0, w - (int) gradient.point2.x, h);
2394 line.setBounds (w - 1, 0, 1, h);
2395 break;
2396
2398 gradient.point2.x = (float) w * shadowSize;
2399 shadowRect.setBounds (0, 0, (int) gradient.point2.x, h);
2400 line.setBounds (0, 0, 1, h);
2401 break;
2402
2404 gradient.point1.y = (float) h;
2405 gradient.point2.y = (float) h * (1.0f - shadowSize);
2406 shadowRect.setBounds (0, (int) gradient.point2.y, w, h - (int) gradient.point2.y);
2407 line.setBounds (0, h - 1, w, 1);
2408 break;
2409
2411 gradient.point2.y = (float) h * shadowSize;
2412 shadowRect.setBounds (0, 0, w, (int) gradient.point2.y);
2413 line.setBounds (0, 0, w, 1);
2414 break;
2415
2416 default: break;
2417 }
2418
2419 g.setGradientFill (gradient);
2420 g.fillRect (shadowRect.expanded (2, 2));
2421
2422 g.setColour (Colour (0x80000000));
2423 g.fillRect (line);
2424}
2425
2427{
2428 auto thickness = 7.0f;
2429 auto indent = 22.0f;
2430
2431 Path p;
2432 p.addEllipse (-10.0f, -10.0f, 120.0f, 120.0f);
2433
2434 DrawablePath ellipse;
2435 ellipse.setPath (p);
2436 ellipse.setFill (Colour (0x99ffffff));
2437
2438 p.clear();
2439 p.addEllipse (0.0f, 0.0f, 100.0f, 100.0f);
2440 p.addRectangle (indent, 50.0f - thickness, 100.0f - indent * 2.0f, thickness * 2.0f);
2441 p.addRectangle (50.0f - thickness, indent, thickness * 2.0f, 50.0f - indent - thickness);
2442 p.addRectangle (50.0f - thickness, 50.0f + thickness, thickness * 2.0f, 50.0f - indent - thickness);
2443 p.setUsingNonZeroWinding (false);
2444
2446 dp.setPath (p);
2447 dp.setFill (Colour (0x59000000));
2448
2449 DrawableComposite normalImage;
2450 normalImage.addAndMakeVisible (ellipse.createCopy().release());
2451 normalImage.addAndMakeVisible (dp.createCopy().release());
2452
2453 dp.setFill (Colour (0xcc000000));
2454
2455 DrawableComposite overImage;
2456 overImage.addAndMakeVisible (ellipse.createCopy().release());
2457 overImage.addAndMakeVisible (dp.createCopy().release());
2458
2459 auto db = new DrawableButton (TRANS ("Additional Items"), DrawableButton::ImageFitted);
2460 db->setImages (&normalImage, &overImage, nullptr);
2461 return db;
2462}
2463
2464
2465//==============================================================================
2467{
2468 g.fillAll (Colours::white);
2469
2470 auto area = header.getLocalBounds();
2471 area.removeFromTop (area.getHeight() / 2);
2472
2473 auto backgroundColour = header.findColour (TableHeaderComponent::backgroundColourId);
2474
2475 g.setGradientFill (ColourGradient (backgroundColour,
2476 0.0f, (float) area.getY(),
2477 backgroundColour.withMultipliedSaturation (.5f),
2478 0.0f, (float) area.getBottom(),
2479 false));
2480 g.fillRect (area);
2481
2483 g.fillRect (area.removeFromBottom (1));
2484
2485 for (int i = header.getNumColumns (true); --i >= 0;)
2486 g.fillRect (header.getColumnPosition (i).removeFromRight (1));
2487}
2488
2490 const String& columnName, int /*columnId*/,
2491 int width, int height, bool isMouseOver, bool isMouseDown,
2492 int columnFlags)
2493{
2494 auto highlightColour = header.findColour (TableHeaderComponent::highlightColourId);
2495
2496 if (isMouseDown)
2497 g.fillAll (highlightColour);
2498 else if (isMouseOver)
2499 g.fillAll (highlightColour.withMultipliedAlpha (0.625f));
2500
2501 Rectangle<int> area (width, height);
2502 area.reduce (4, 0);
2503
2505 {
2506 Path sortArrow;
2507 sortArrow.addTriangle (0.0f, 0.0f,
2508 0.5f, (columnFlags & TableHeaderComponent::sortedForwards) != 0 ? -0.8f : 0.8f,
2509 1.0f, 0.0f);
2510
2511 g.setColour (Colour (0x99000000));
2512 g.fillPath (sortArrow, sortArrow.getTransformToScaleToFit (area.removeFromRight (height / 2).reduced (2).toFloat(), true));
2513 }
2514
2515 g.setColour (header.findColour (TableHeaderComponent::textColourId));
2516 g.setFont (Font ((float) height * 0.5f, Font::bold));
2517 g.drawFittedText (columnName, area, Justification::centredLeft, 1);
2518}
2519
2520//==============================================================================
2522{
2523 const int outlineThickness = 1;
2524
2525 g.fillAll (lassoComp.findColour (0x1000440 /*lassoFillColourId*/));
2526
2527 g.setColour (lassoComp.findColour (0x1000441 /*lassoOutlineColourId*/));
2528 g.drawRect (lassoComp.getLocalBounds(), outlineThickness);
2529}
2530
2531//==============================================================================
2533{
2534 auto background = toolbar.findColour (Toolbar::backgroundColourId);
2535
2536 g.setGradientFill (ColourGradient (background, 0.0f, 0.0f,
2537 background.darker (0.1f),
2538 toolbar.isVertical() ? (float) w - 1.0f : 0.0f,
2539 toolbar.isVertical() ? 0.0f : (float) h - 1.0f,
2540 false));
2541 g.fillAll();
2542}
2543
2548
2549void LookAndFeel_V2::paintToolbarButtonBackground (Graphics& g, int /*width*/, int /*height*/,
2550 bool isMouseOver, bool isMouseDown,
2551 ToolbarItemComponent& component)
2552{
2553 if (isMouseDown)
2554 g.fillAll (component.findColour (Toolbar::buttonMouseDownBackgroundColourId, true));
2555 else if (isMouseOver)
2556 g.fillAll (component.findColour (Toolbar::buttonMouseOverBackgroundColourId, true));
2557}
2558
2560 const String& text, ToolbarItemComponent& component)
2561{
2562 g.setColour (component.findColour (Toolbar::labelTextColourId, true)
2563 .withAlpha (component.isEnabled() ? 1.0f : 0.25f));
2564
2565 auto fontHeight = jmin (14.0f, (float) height * 0.85f);
2566 g.setFont (fontHeight);
2567
2568 g.drawFittedText (text,
2569 x, y, width, height,
2571 jmax (1, height / (int) fontHeight));
2572}
2573
2574//==============================================================================
2576 bool isOpen, int width, int height)
2577{
2578 auto buttonSize = (float) height * 0.75f;
2579 auto buttonIndent = ((float) height - buttonSize) * 0.5f;
2580
2581 drawTreeviewPlusMinusBox (g, Rectangle<float> (buttonIndent, buttonIndent, buttonSize, buttonSize), Colours::white, isOpen, false);
2582
2583 auto textX = (int) (buttonIndent * 2.0f + buttonSize + 2.0f);
2584
2585 g.setColour (Colours::black);
2586 g.setFont (Font ((float) height * 0.7f, Font::bold));
2587 g.drawText (name, textX, 0, width - textX - 4, height, Justification::centredLeft, true);
2588}
2589
2591{
2592 g.setColour (component.findColour (PropertyComponent::backgroundColourId));
2593 g.fillRect (0, 0, width, height - 1);
2594}
2595
2597{
2599 .withMultipliedAlpha (component.isEnabled() ? 1.0f : 0.6f));
2600
2601 g.setFont ((float) jmin (height, 24) * 0.65f);
2602
2603 auto r = getPropertyComponentContentPosition (component);
2604
2605 g.drawFittedText (component.getName(),
2606 3, r.getY(), r.getX() - 5, r.getHeight(),
2608}
2609
2611{
2612 const int textW = jmin (200, component.getWidth() / 3);
2613 return Rectangle<int> (textW, 1, component.getWidth() - textW - 1, component.getHeight() - 3);
2614}
2615
2617{
2618 return sectionTitle.isEmpty() ? 0 : 22;
2619}
2620
2621//==============================================================================
2623 const Path& path, Image& cachedImage)
2624{
2625 if (cachedImage.isNull())
2626 {
2627 cachedImage = Image (Image::ARGB, box.getWidth(), box.getHeight(), true);
2628 Graphics g2 (cachedImage);
2629
2630 DropShadow (Colours::black.withAlpha (0.7f), 8, Point<int> (0, 2)).drawForPath (g2, path);
2631 }
2632
2633 g.setColour (Colours::black);
2634 g.drawImageAt (cachedImage, 0, 0);
2635
2636 g.setColour (Colour::greyLevel (0.23f).withAlpha (0.9f));
2637 g.fillPath (path);
2638
2639 g.setColour (Colours::white.withAlpha (0.8f));
2640 g.strokePath (path, PathStrokeType (2.0f));
2641}
2642
2644{
2645 return 20;
2646}
2647
2649{
2650 return 9.0f;
2651}
2652
2653//==============================================================================
2655 const String& instructions)
2656{
2658 s.setJustification (Justification::centred);
2659
2661 s.append (title + "\n\n", Font (17.0f, Font::bold), colour);
2662 s.append (instructions, Font (14.0f), colour);
2663
2664 return s;
2665}
2666
2668 const File&, const String& filename, Image* icon,
2669 const String& fileSizeDescription,
2670 const String& fileTimeDescription,
2671 bool isDirectory, bool isItemSelected,
2672 int /*itemIndex*/, DirectoryContentsDisplayComponent& dcc)
2673{
2674 auto fileListComp = dynamic_cast<Component*> (&dcc);
2675
2676 if (isItemSelected)
2677 g.fillAll (fileListComp != nullptr ? fileListComp->findColour (DirectoryContentsDisplayComponent::highlightColourId)
2679
2680 const int x = 32;
2681 g.setColour (Colours::black);
2682
2683 if (icon != nullptr && icon->isValid())
2684 {
2685 g.drawImageWithin (*icon, 2, 2, x - 4, height - 4,
2687 false);
2688 }
2689 else
2690 {
2691 if (auto* d = isDirectory ? getDefaultFolderImage()
2693 d->drawWithin (g, Rectangle<float> (2.0f, 2.0f, x - 4.0f, (float) height - 4.0f),
2695 }
2696
2697 if (isItemSelected)
2698 g.setColour (fileListComp != nullptr ? fileListComp->findColour (DirectoryContentsDisplayComponent::highlightedTextColourId)
2700 else
2701 g.setColour (fileListComp != nullptr ? fileListComp->findColour (DirectoryContentsDisplayComponent::textColourId)
2703
2704 g.setFont ((float) height * 0.7f);
2705
2706 if (width > 450 && ! isDirectory)
2707 {
2708 auto sizeX = roundToInt ((float) width * 0.7f);
2709 auto dateX = roundToInt ((float) width * 0.8f);
2710
2711 g.drawFittedText (filename,
2712 x, 0, sizeX - x, height,
2714
2715 g.setFont ((float) height * 0.5f);
2716 g.setColour (Colours::darkgrey);
2717
2718 if (! isDirectory)
2719 {
2720 g.drawFittedText (fileSizeDescription,
2721 sizeX, 0, dateX - sizeX - 8, height,
2723
2724 g.drawFittedText (fileTimeDescription,
2725 dateX, 0, width - 8 - dateX, height,
2727 }
2728 }
2729 else
2730 {
2731 g.drawFittedText (filename,
2732 x, 0, width - x, height,
2734
2735 }
2736}
2737
2739{
2740 auto goUpButton = new DrawableButton ("up", DrawableButton::ImageOnButtonBackground);
2741
2742 Path arrowPath;
2743 arrowPath.addArrow ({ 50.0f, 100.0f, 50.0f, 0.0f }, 40.0f, 100.0f, 50.0f);
2744
2745 DrawablePath arrowImage;
2746 arrowImage.setFill (Colours::black.withAlpha (0.4f));
2747 arrowImage.setPath (arrowPath);
2748
2749 goUpButton->setImages (&arrowImage);
2750
2751 return goUpButton;
2752}
2753
2755 DirectoryContentsDisplayComponent* fileListComponent,
2756 FilePreviewComponent* previewComp,
2757 ComboBox* currentPathBox,
2758 TextEditor* filenameBox,
2759 Button* goUpButton)
2760{
2761 const int x = 8;
2762 auto w = browserComp.getWidth() - x - x;
2763
2764 if (previewComp != nullptr)
2765 {
2766 auto previewWidth = w / 3;
2767 previewComp->setBounds (x + w - previewWidth, 0, previewWidth, browserComp.getHeight());
2768
2769 w -= previewWidth + 4;
2770 }
2771
2772 int y = 4;
2773
2774 const int controlsHeight = 22;
2775 const int upButtonWidth = 50;
2776 auto bottomSectionHeight = controlsHeight + 8;
2777
2778 currentPathBox->setBounds (x, y, w - upButtonWidth - 6, controlsHeight);
2779 goUpButton->setBounds (x + w - upButtonWidth, y, upButtonWidth, controlsHeight);
2780
2781 y += controlsHeight + 4;
2782
2783 if (auto listAsComp = dynamic_cast<Component*> (fileListComponent))
2784 {
2785 listAsComp->setBounds (x, y, w, browserComp.getHeight() - y - bottomSectionHeight);
2786 y = listAsComp->getBottom() + 4;
2787 }
2788
2789 filenameBox->setBounds (x + 50, y, w - 50, controlsHeight);
2790}
2791
2792//==============================================================================
2793static std::unique_ptr<Drawable> createDrawableFromSVG (const char* data)
2794{
2795 auto xml = parseXML (data);
2796 jassert (xml != nullptr);
2797 return Drawable::createFromSVG (*xml);
2798}
2799
2801{
2802 if (folderImage == nullptr)
2804<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="706" height="532">
2805 <defs>
2806 <linearGradient id="a">
2807 <stop stop-color="#adf" offset="0"/>
2808 <stop stop-color="#ecfaff" offset="1"/>
2809 </linearGradient>
2810 <linearGradient id="b" x1=".6" x2="0" y1=".9" xlink:href="#a"/>
2811 <linearGradient id="c" x1=".6" x2=".1" y1=".9" y2=".3" xlink:href="#a"/>
2812 </defs>
2813 <g class="currentLayer">
2814 <path d="M112.1 104c-8.2 2.2-13.2 11.6-11.3 21l68.3 342.7c1.9 9.4 10.1 15.2 18.4 13l384.3-104.1c8.2-2.2 13.2-11.6 11.3-21l-48-266a15.8 15.8 0 0 0-18.4-12.8l-224.2 38s-20.3-41.3-28.3-39.3z" display="block" fill="url(#b)" stroke="#446c98" stroke-width="7"/>
2815 <path d="M608.6 136.8L235.2 208a22.7 22.7 0 0 0-16 19l-40.8 241c1.7 8.4 9.6 14.5 17.8 12.3l380-104c8-2.2 10.7-10.2 12.3-18.4l38-210.1c.4-15.4-10.4-11.8-18-11.1z" display="block" fill="url(#c)" opacity=".8" stroke="#446c98" stroke-width="7"/>
2816 </g>
2817</svg>
2818)svgdata");
2819
2820 return folderImage.get();
2821}
2822
2823const Drawable* LookAndFeel_V2::getDefaultDocumentFileImage()
2824{
2825 if (documentImage == nullptr)
2827<svg version="1" viewBox="-10 -10 450 600" xmlns="http://www.w3.org/2000/svg">
2828 <path d="M17 0h290l120 132v426c0 10-8 19-17 19H17c-9 0-17-9-17-19V19C0 8 8 0 17 0z" fill="#e5e5e5" stroke="#888888" stroke-width="7"/>
2829 <path d="M427 132H324c-9 0-17-9-17-19V0l120 132z" fill="#ccc"/>
2830</svg>
2831)svgdata");
2832
2833 return documentImage.get();
2834}
2835
2836//==============================================================================
2837static Path createPathFromData (float height, const unsigned char* data, size_t size)
2838{
2840 p.loadPathFromData (data, size);
2841 p.scaleToFit (0, 0, height * 2.0f, height, true);
2842 return p;
2843}
2844
2846{
2847 static const unsigned char data[] =
2848 {
2849 109,0,224,168,68,0,0,119,67,108,0,224,172,68,0,128,146,67,113,0,192,148,68,0,0,219,67,0,96,110,68,0,224,56,68,113,0,64,51,68,0,32,130,68,0,64,20,68,0,224,
2850 162,68,108,0,128,3,68,0,128,168,68,113,0,128,221,67,0,192,175,68,0,0,207,67,0,32,179,68,113,0,0,201,67,0,224,173,68,0,0,181,67,0,224,161,68,108,0,128,168,67,
2851 0,128,154,68,113,0,128,141,67,0,192,138,68,0,128,108,67,0,64,131,68,113,0,0,62,67,0,128,119,68,0,0,5,67,0,128,114,68,113,0,0,102,67,0,192,88,68,0,128,155,
2852 67,0,192,88,68,113,0,0,190,67,0,192,88,68,0,128,232,67,0,224,131,68,108,0,128,246,67,0,192,139,68,113,0,64,33,68,0,128,87,68,0,0,93,68,0,224,26,68,113,0,
2853 96,140,68,0,128,188,67,0,224,168,68,0,0,119,67,99,101
2854 };
2855
2856 return createPathFromData (height, data, sizeof (data));
2857}
2858
2860{
2861 static const unsigned char data[] =
2862 {
2863 109,0,0,17,68,0,96,145,68,108,0,192,13,68,0,192,147,68,113,0,0,213,67,0,64,174,68,0,0,168,67,0,64,174,68,113,0,0,104,67,0,64,174,68,0,0,5,67,0,64,
2864 153,68,113,0,0,18,67,0,64,153,68,0,0,24,67,0,64,153,68,113,0,0,135,67,0,64,153,68,0,128,207,67,0,224,130,68,108,0,0,220,67,0,0,126,68,108,0,0,204,67,
2865 0,128,117,68,113,0,0,138,67,0,64,82,68,0,0,138,67,0,192,57,68,113,0,0,138,67,0,192,37,68,0,128,210,67,0,64,10,68,113,0,128,220,67,0,64,45,68,0,0,8,
2866 68,0,128,78,68,108,0,192,14,68,0,0,87,68,108,0,64,20,68,0,0,80,68,113,0,192,57,68,0,0,32,68,0,128,88,68,0,0,32,68,113,0,64,112,68,0,0,32,68,0,
2867 128,124,68,0,64,68,68,113,0,0,121,68,0,192,67,68,0,128,119,68,0,192,67,68,113,0,192,108,68,0,192,67,68,0,32,89,68,0,96,82,68,113,0,128,69,68,0,0,97,68,
2868 0,0,56,68,0,64,115,68,108,0,64,49,68,0,128,124,68,108,0,192,55,68,0,96,129,68,113,0,0,92,68,0,224,146,68,0,192,129,68,0,224,146,68,113,0,64,110,68,0,64,
2869 168,68,0,64,87,68,0,64,168,68,113,0,128,66,68,0,64,168,68,0,64,27,68,0,32,150,68,99,101
2870 };
2871
2872 return createPathFromData (height, data, sizeof (data));
2873}
2874
2875//==============================================================================
2876void LookAndFeel_V2::drawLevelMeter (Graphics& g, int width, int height, float level)
2877{
2878 g.setColour (Colours::white.withAlpha (0.7f));
2879 g.fillRoundedRectangle (0.0f, 0.0f, (float) width, (float) height, 3.0f);
2880 g.setColour (Colours::black.withAlpha (0.2f));
2881 g.drawRoundedRectangle (1.0f, 1.0f, (float) width - 2.0f, (float) height - 2.0f, 3.0f, 1.0f);
2882
2883 const int totalBlocks = 7;
2884 const int numBlocks = roundToInt (totalBlocks * level);
2885 auto w = ((float) width - 6.0f) / (float) totalBlocks;
2886
2887 for (int i = 0; i < totalBlocks; ++i)
2888 {
2889 if (i >= numBlocks)
2890 g.setColour (Colours::lightblue.withAlpha (0.6f));
2891 else
2892 g.setColour (i < totalBlocks - 1 ? Colours::blue.withAlpha (0.5f)
2893 : Colours::red);
2894
2895 g.fillRoundedRectangle (3.0f + (float) i * w + w * 0.1f,
2896 3.0f,
2897 (float) w * 0.8f,
2898 (float) height - 6.0f,
2899 (float) w * 0.4f);
2900 }
2901}
2902
2903//==============================================================================
2904void LookAndFeel_V2::drawKeymapChangeButton (Graphics& g, int width, int height, Button& button, const String& keyDescription)
2905{
2906 auto textColour = button.findColour (0x100ad01 /*KeyMappingEditorComponent::textColourId*/, true);
2907
2908 if (keyDescription.isNotEmpty())
2909 {
2910 if (button.isEnabled())
2911 {
2912 auto alpha = button.isDown() ? 0.3f : (button.isOver() ? 0.15f : 0.08f);
2913 g.fillAll (textColour.withAlpha (alpha));
2914
2915 g.setOpacity (0.3f);
2916 drawBevel (g, 0, 0, width, height, 2);
2917 }
2918
2919 g.setColour (textColour);
2920 g.setFont ((float) height * 0.6f);
2921 g.drawFittedText (keyDescription,
2922 3, 0, width - 6, height,
2923 Justification::centred, 1);
2924 }
2925 else
2926 {
2927 const float thickness = 7.0f;
2928 const float indent = 22.0f;
2930 Path p;
2931 p.addEllipse (0.0f, 0.0f, 100.0f, 100.0f);
2932 p.addRectangle (indent, 50.0f - thickness, 100.0f - indent * 2.0f, thickness * 2.0f);
2933 p.addRectangle (50.0f - thickness, indent, thickness * 2.0f, 50.0f - indent - thickness);
2934 p.addRectangle (50.0f - thickness, 50.0f + thickness, thickness * 2.0f, 50.0f - indent - thickness);
2935 p.setUsingNonZeroWinding (false);
2936
2937 g.setColour (textColour.withAlpha (button.isDown() ? 0.7f : (button.isOver() ? 0.5f : 0.3f)));
2938 g.fillPath (p, p.getTransformToScaleToFit (2.0f, 2.0f, (float) width - 4.0f, (float) height - 4.0f, true));
2939 }
2941 if (button.hasKeyboardFocus (false))
2942 {
2943 g.setColour (textColour.withAlpha (0.4f));
2944 g.drawRect (0, 0, width, height);
2945 }
2947
2948//==============================================================================
2950{
2951 return Font (18.0f);
2952}
2953
2954Justification LookAndFeel_V2::getSidePanelTitleJustification (SidePanel& panel)
2955{
2956 return panel.isPanelOnLeft() ? Justification::centredRight
2957 : Justification::centredLeft;
2958}
2959
2960Path LookAndFeel_V2::getSidePanelDismissButtonShape (SidePanel& panel)
2961{
2962 return getCrossShape ((float) panel.getTitleBarHeight());
2963}
2964
2965//==============================================================================
2966void LookAndFeel_V2::drawBevel (Graphics& g, const int x, const int y, const int width, const int height,
2967 const int bevelThickness, const Colour& topLeftColour, const Colour& bottomRightColour,
2968 const bool useGradient, const bool sharpEdgeOnOutside)
2969{
2970 if (g.clipRegionIntersects (Rectangle<int> (x, y, width, height)))
2971 {
2972 auto& context = g.getInternalContext();
2974
2975 for (int i = bevelThickness; --i >= 0;)
2976 {
2977 const float op = useGradient ? (float) (sharpEdgeOnOutside ? bevelThickness - i : i) / (float) bevelThickness
2978 : 1.0f;
2979
2980 context.setFill (topLeftColour.withMultipliedAlpha (op));
2981 context.fillRect (Rectangle<int> (x + i, y + i, width - i * 2, 1), false);
2982 context.setFill (topLeftColour.withMultipliedAlpha (op * 0.75f));
2983 context.fillRect (Rectangle<int> (x + i, y + i + 1, 1, height - i * 2 - 2), false);
2984 context.setFill (bottomRightColour.withMultipliedAlpha (op));
2985 context.fillRect (Rectangle<int> (x + i, y + height - i - 1, width - i * 2, 1), false);
2986 context.setFill (bottomRightColour.withMultipliedAlpha (op * 0.75f));
2987 context.fillRect (Rectangle<int> (x + width - i - 1, y + i + 1, 1, height - i * 2 - 2), false);
2988 }
2989 }
2990}
2991
2992//==============================================================================
2993void LookAndFeel_V2::drawShinyButtonShape (Graphics& g, float x, float y, float w, float h,
2994 float maxCornerSize, const Colour& baseColour, float strokeWidth,
2995 bool flatOnLeft, bool flatOnRight, bool flatOnTop, bool flatOnBottom) noexcept
2996{
2997 if (w <= strokeWidth * 1.1f || h <= strokeWidth * 1.1f)
2998 return;
2999
3000 auto cs = jmin (maxCornerSize, w * 0.5f, h * 0.5f);
3001
3002 Path outline;
3003 outline.addRoundedRectangle (x, y, w, h, cs, cs,
3004 ! (flatOnLeft || flatOnTop),
3005 ! (flatOnRight || flatOnTop),
3006 ! (flatOnLeft || flatOnBottom),
3007 ! (flatOnRight || flatOnBottom));
3008
3009 ColourGradient cg (baseColour, 0.0f, y,
3010 baseColour.overlaidWith (Colour (0x070000ff)), 0.0f, y + h,
3011 false);
3012
3013 cg.addColour (0.5, baseColour.overlaidWith (Colour (0x33ffffff)));
3014 cg.addColour (0.51, baseColour.overlaidWith (Colour (0x110000ff)));
3015
3016 g.setGradientFill (cg);
3017 g.fillPath (outline);
3018
3019 g.setColour (Colour (0x80000000));
3020 g.strokePath (outline, PathStrokeType (strokeWidth));
3021}
3022
3023//==============================================================================
3024void LookAndFeel_V2::drawGlassSphere (Graphics& g, const float x, const float y,
3025 const float diameter, const Colour& colour,
3026 const float outlineThickness) noexcept
3027{
3028 if (diameter <= outlineThickness)
3029 return;
3030
3031 Path p;
3032 p.addEllipse (x, y, diameter, diameter);
3033
3034 {
3035 ColourGradient cg (Colours::white.overlaidWith (colour.withMultipliedAlpha (0.3f)), 0, y,
3036 Colours::white.overlaidWith (colour.withMultipliedAlpha (0.3f)), 0, y + diameter, false);
3037
3038 cg.addColour (0.4, Colours::white.overlaidWith (colour));
3039
3040 g.setGradientFill (cg);
3041 g.fillPath (p);
3042 }
3043
3044 g.setGradientFill (ColourGradient (Colours::white, 0, y + diameter * 0.06f,
3045 Colours::transparentWhite, 0, y + diameter * 0.3f, false));
3046 g.fillEllipse (x + diameter * 0.2f, y + diameter * 0.05f, diameter * 0.6f, diameter * 0.4f);
3047
3049 x + diameter * 0.5f, y + diameter * 0.5f,
3050 Colours::black.withAlpha (0.5f * outlineThickness * colour.getFloatAlpha()),
3051 x, y + diameter * 0.5f, true);
3052
3053 cg.addColour (0.7, Colours::transparentBlack);
3054 cg.addColour (0.8, Colours::black.withAlpha (0.1f * outlineThickness));
3055
3056 g.setGradientFill (cg);
3057 g.fillPath (p);
3058
3059 g.setColour (Colours::black.withAlpha (0.5f * colour.getFloatAlpha()));
3060 g.drawEllipse (x, y, diameter, diameter, outlineThickness);
3061}
3062
3063//==============================================================================
3065 const float x, const float y, const float diameter,
3066 const Colour& colour, const float outlineThickness,
3067 const int direction) noexcept
3068{
3069 if (diameter <= outlineThickness)
3070 return;
3071
3072 Path p;
3073 p.startNewSubPath (x + diameter * 0.5f, y);
3074 p.lineTo (x + diameter, y + diameter * 0.6f);
3075 p.lineTo (x + diameter, y + diameter);
3076 p.lineTo (x, y + diameter);
3077 p.lineTo (x, y + diameter * 0.6f);
3078 p.closeSubPath();
3079
3080 p.applyTransform (AffineTransform::rotation ((float) direction * MathConstants<float>::halfPi,
3081 x + diameter * 0.5f,
3082 y + diameter * 0.5f));
3083
3084 {
3085 ColourGradient cg (Colours::white.overlaidWith (colour.withMultipliedAlpha (0.3f)), 0, y,
3086 Colours::white.overlaidWith (colour.withMultipliedAlpha (0.3f)), 0, y + diameter, false);
3087
3088 cg.addColour (0.4, Colours::white.overlaidWith (colour));
3089
3090 g.setGradientFill (cg);
3091 g.fillPath (p);
3092 }
3093
3095 x + diameter * 0.5f, y + diameter * 0.5f,
3096 Colours::black.withAlpha (0.5f * outlineThickness * colour.getFloatAlpha()),
3097 x - diameter * 0.2f, y + diameter * 0.5f, true);
3098
3099 cg.addColour (0.5, Colours::transparentBlack);
3100 cg.addColour (0.7, Colours::black.withAlpha (0.07f * outlineThickness));
3101
3102 g.setGradientFill (cg);
3103 g.fillPath (p);
3104
3105 g.setColour (Colours::black.withAlpha (0.5f * colour.getFloatAlpha()));
3106 g.strokePath (p, PathStrokeType (outlineThickness));
3107}
3108
3109//==============================================================================
3110void LookAndFeel_V2::drawGlassLozenge (Graphics& g,
3111 float x, float y, float width, float height,
3112 const Colour& colour, float outlineThickness, float cornerSize,
3113 bool flatOnLeft, bool flatOnRight, bool flatOnTop, bool flatOnBottom) noexcept
3114{
3115 if (width <= outlineThickness || height <= outlineThickness)
3116 return;
3117
3118 auto intX = (int) x;
3119 auto intY = (int) y;
3120 auto intW = (int) width;
3121 auto intH = (int) height;
3122
3123 auto cs = cornerSize < 0 ? jmin (width * 0.5f, height * 0.5f) : cornerSize;
3124 auto edgeBlurRadius = height * 0.75f + (height - cs * 2.0f);
3125 auto intEdge = (int) edgeBlurRadius;
3126
3127 Path outline;
3128 outline.addRoundedRectangle (x, y, width, height, cs, cs,
3129 ! (flatOnLeft || flatOnTop),
3130 ! (flatOnRight || flatOnTop),
3131 ! (flatOnLeft || flatOnBottom),
3132 ! (flatOnRight || flatOnBottom));
3133
3134 {
3135 ColourGradient cg (colour.darker (0.2f), 0, y,
3136 colour.darker (0.2f), 0, y + height, false);
3137
3138 cg.addColour (0.03, colour.withMultipliedAlpha (0.3f));
3139 cg.addColour (0.4, colour);
3140 cg.addColour (0.97, colour.withMultipliedAlpha (0.3f));
3141
3142 g.setGradientFill (cg);
3143 g.fillPath (outline);
3144 }
3145
3146 ColourGradient cg (Colours::transparentBlack, x + edgeBlurRadius, y + height * 0.5f,
3147 colour.darker (0.2f), x, y + height * 0.5f, true);
3148
3149 cg.addColour (jlimit (0.0, 1.0, 1.0 - (cs * 0.5f) / edgeBlurRadius), Colours::transparentBlack);
3150 cg.addColour (jlimit (0.0, 1.0, 1.0 - (cs * 0.25f) / edgeBlurRadius), colour.darker (0.2f).withMultipliedAlpha (0.3f));
3151
3152 if (! (flatOnLeft || flatOnTop || flatOnBottom))
3153 {
3154 Graphics::ScopedSaveState ss (g);
3155
3156 g.setGradientFill (cg);
3157 g.reduceClipRegion (intX, intY, intEdge, intH);
3158 g.fillPath (outline);
3159 }
3160
3161 if (! (flatOnRight || flatOnTop || flatOnBottom))
3162 {
3163 cg.point1.setX (x + width - edgeBlurRadius);
3164 cg.point2.setX (x + width);
3165
3166 Graphics::ScopedSaveState ss (g);
3167
3168 g.setGradientFill (cg);
3169 g.reduceClipRegion (intX + intW - intEdge, intY, 2 + intEdge, intH);
3170 g.fillPath (outline);
3171 }
3172
3173 {
3174 auto leftIndent = (flatOnTop || flatOnLeft) ? 0.0f : cs * 0.4f;
3175 auto rightIndent = (flatOnTop || flatOnRight) ? 0.0f : cs * 0.4f;
3176
3177 Path highlight;
3178 highlight.addRoundedRectangle (x + leftIndent,
3179 y + cs * 0.1f,
3180 width - (leftIndent + rightIndent),
3181 height * 0.4f,
3182 cs * 0.4f,
3183 cs * 0.4f,
3184 ! (flatOnLeft || flatOnTop),
3185 ! (flatOnRight || flatOnTop),
3186 ! (flatOnLeft || flatOnBottom),
3187 ! (flatOnRight || flatOnBottom));
3188
3189 g.setGradientFill (ColourGradient (colour.brighter (10.0f), 0, y + height * 0.06f,
3190 Colours::transparentWhite, 0, y + height * 0.4f, false));
3191 g.fillPath (highlight);
3192 }
3193
3194 g.setColour (colour.darker().withMultipliedAlpha (1.5f));
3195 g.strokePath (outline, PathStrokeType (outlineThickness));
3196}
3197
3198} // namespace juce
Type jmin(const Type a, const Type b)
Definition MathsFunctions.h:60
Type jmax(const Type a, const Type b)
Definition MathsFunctions.h:48
#define noexcept
Definition DistrhoDefines.h:72
int dp
Definition Spc_Cpu.h:149
static void message(int level, const char *fmt,...)
Definition adplugdb.cpp:120
Definition String.h:48
bool isNotEmpty() const noexcept
Definition String.h:244
Definition juce_AffineTransform.h:43
static AffineTransform scale(float factorX, float factorY) noexcept
Definition juce_AffineTransform.cpp:141
static AffineTransform translation(float deltaX, float deltaY) noexcept
Definition juce_AffineTransform.cpp:81
static AffineTransform rotation(float angleInRadians) noexcept
Definition juce_AffineTransform.cpp:106
Definition juce_AlertWindow.h:45
@ textColourId
Definition juce_AlertWindow.h:444
@ outlineColourId
Definition juce_AlertWindow.h:445
@ backgroundColourId
Definition juce_AlertWindow.h:443
void addButton(const String &name, int returnValue, const KeyPress &shortcutKey1=KeyPress(), const KeyPress &shortcutKey2=KeyPress())
Definition juce_AlertWindow.cpp:111
int getNumButtons() const
Definition juce_AlertWindow.cpp:143
MessageBoxIconType getAlertType() const noexcept
Definition juce_AlertWindow.h:69
bool containsAnyExtraComponents() const
Definition juce_AlertWindow.cpp:511
Definition juce_Array.h:56
int size() const noexcept
Definition juce_Array.h:215
void add(const ElementType &newElement)
Definition juce_Array.h:418
ElementType & getReference(int index) noexcept
Definition juce_Array.h:267
Definition juce_AttributedString.h:47
@ backgroundColourId
Definition juce_BooleanPropertyComponent.h:92
@ outlineColourId
Definition juce_BooleanPropertyComponent.h:93
Definition juce_BorderSize.h:42
Definition juce_BubbleComponent.h:47
@ above
Definition juce_BubbleComponent.h:69
@ left
Definition juce_BubbleComponent.h:71
@ below
Definition juce_BubbleComponent.h:70
@ right
Definition juce_BubbleComponent.h:72
@ outlineColourId
Definition juce_BubbleComponent.h:143
@ 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_CallOutBox.h:61
Definition juce_CaretComponent.h:36
@ caretColourId
Definition juce_CaretComponent.h:65
static juce_wchar toLowerCase(juce_wchar character) noexcept
Definition juce_CharacterFunctions.cpp:33
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
static JUCE_NODISCARD Colour greyLevel(float brightness) noexcept
Definition juce_Colour.cpp:484
Colour withMultipliedAlpha(float alphaMultiplier) const noexcept
Definition juce_Colour.cpp:333
bool isOpaque() const noexcept
Definition juce_Colour.cpp:312
JUCE_NODISCARD Colour contrasting(float amount=1.0f) const noexcept
Definition juce_Colour.cpp:491
bool isTransparent() const noexcept
Definition juce_Colour.cpp:307
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
@ textColourId
Definition juce_ComboBox.h:357
@ buttonColourId
Definition juce_ComboBox.h:359
@ backgroundColourId
Definition juce_ComboBox.h:356
Definition juce_Component.h:36
bool isColourSpecified(int colourID) const
Definition juce_Component.cpp:2231
int getHeight() const noexcept
Definition juce_Component.h:274
int getX() const noexcept
Definition juce_Component.h:259
void setTopRightPosition(int x, int y)
Definition juce_Component.cpp:1267
void addAndMakeVisible(Component *child, int zOrder=-1)
Definition juce_Component.cpp:1554
bool hasKeyboardFocus(bool trueIfChildIsFocused) const
Definition juce_Component.cpp:3086
void setBounds(int x, int y, int width, int height)
Definition juce_Component.cpp:1147
void setSize(int newWidth, int newHeight)
Definition juce_Component.cpp:1262
Colour findColour(int colourID, bool inheritFromParent=false) const
Definition juce_Component.cpp:2219
static std::unique_ptr< AccessibilityHandler > createIgnoredAccessibilityHandler(Component &)
Definition juce_Component.cpp:3292
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
@ windowHasDropShadow
Definition juce_ComponentPeer.h:66
@ windowAppearsOnTaskbar
Definition juce_ComponentPeer.h:50
Definition juce_ConcertinaPanel.h:40
Definition juce_DirectoryContentsDisplayComponent.h:38
@ textColourId
Definition juce_DirectoryContentsDisplayComponent.h:96
@ highlightColourId
Definition juce_DirectoryContentsDisplayComponent.h:95
@ highlightedTextColourId
Definition juce_DirectoryContentsDisplayComponent.h:97
Definition juce_DocumentWindow.h:55
@ textColourId
Definition juce_DocumentWindow.h:236
@ closeButton
Definition juce_DocumentWindow.h:66
@ maximiseButton
Definition juce_DocumentWindow.h:65
@ minimiseButton
Definition juce_DocumentWindow.h:64
Definition juce_DrawableButton.h:41
@ ImageFitted
Definition juce_DrawableButton.h:46
@ ImageAboveTextLabel
Definition juce_DrawableButton.h:49
@ ImageOnButtonBackground
Definition juce_DrawableButton.h:50
@ textColourOnId
Definition juce_DrawableButton.h:159
@ textColourId
Definition juce_DrawableButton.h:158
@ backgroundColourId
Definition juce_DrawableButton.h:161
@ backgroundOnColourId
Definition juce_DrawableButton.h:165
Definition juce_DrawableComposite.h:43
Definition juce_Drawable.h:38
static std::unique_ptr< Drawable > createFromSVG(const XmlElement &svgDocument)
Definition juce_SVGParser.cpp:1757
void drawWithin(Graphics &g, Rectangle< float > destArea, RectanglePlacement placement, float opacity) const
Definition juce_Drawable.cpp:102
Definition juce_DrawablePath.h:40
void setPath(const Path &newPath)
Definition juce_DrawablePath.cpp:42
std::unique_ptr< Drawable > createCopy() const override
Definition juce_DrawablePath.cpp:37
void setFill(const FillType &newFill)
Definition juce_DrawableShape.cpp:50
Definition juce_FileBrowserComponent.h:45
@ currentPathBoxTextColourId
Definition juce_FileBrowserComponent.h:226
@ filenameBoxBackgroundColourId
Definition juce_FileBrowserComponent.h:228
@ currentPathBoxBackgroundColourId
Definition juce_FileBrowserComponent.h:225
@ filenameBoxTextColourId
Definition juce_FileBrowserComponent.h:229
@ currentPathBoxArrowColourId
Definition juce_FileBrowserComponent.h:227
@ titleTextColourId
Definition juce_FileChooserDialogBox.h:142
Definition juce_File.h:45
Definition juce_FilePreviewComponent.h:44
@ backgroundColourId
Definition juce_FileSearchPathListComponent.h:70
Definition juce_FilenameComponent.h:71
Definition juce_Font.h:42
JUCE_NODISCARD Font withHeight(float height) const
Definition juce_Font.cpp:549
void setUnderline(bool shouldBeUnderlined)
Definition juce_Font.cpp:723
float getHeight() const noexcept
Definition juce_Font.cpp:735
int getStringWidth(const String &text) const
Definition juce_Font.cpp:742
void setHorizontalScale(float scaleFactor)
Definition juce_Font.cpp:671
JUCE_NODISCARD Font boldened() const
Definition juce_Font.cpp:702
@ bold
Definition juce_Font.h:51
void setHeight(float newHeight)
Definition juce_Font.cpp:568
Definition juce_GlyphArrangement.h:117
void createPath(Path &path) const
Definition juce_GlyphArrangement.cpp:748
void addFittedText(const Font &font, const String &text, float x, float y, float width, float height, Justification layout, int maximumLinesToUse, float minimumHorizontalScale=0.0f)
Definition juce_GlyphArrangement.cpp:310
Definition juce_GraphicsContext.h:660
Definition juce_GraphicsContext.h:45
Definition juce_GroupComponent.h:38
@ textColourId
Definition juce_GroupComponent.h:81
@ outlineColourId
Definition juce_GroupComponent.h:80
Definition juce_ImageButton.h:41
Definition juce_ImageEffectFilter.h:43
Definition juce_Image.h:58
int getWidth() const noexcept
Definition juce_Image.cpp:271
int getHeight() const noexcept
Definition juce_Image.cpp:272
bool isNull() const noexcept
Definition juce_Image.h:155
bool isValid() const noexcept
Definition juce_Image.h:147
@ ARGB
Definition juce_Image.h:67
Definition juce_Justification.h:41
@ centredRight
Definition juce_Justification.h:148
@ centred
Definition juce_Justification.h:138
@ centredLeft
Definition juce_Justification.h:143
@ horizontallyCentred
Definition juce_Justification.h:115
@ right
Definition juce_Justification.h:111
@ bottomLeft
Definition juce_Justification.h:173
Definition juce_KeyPress.h:40
static const int escapeKey
Definition juce_KeyPress.h:190
static const int returnKey
Definition juce_KeyPress.h:191
Definition juce_Label.h:41
@ outlineColourId
Definition juce_Label.h:108
@ backgroundColourId
Definition juce_Label.h:106
@ textColourId
Definition juce_Label.h:107
Label(const String &componentName=String(), const String &labelText=String())
Definition juce_Label.cpp:29
Definition juce_Line.h:47
@ textColourId
Definition juce_ListBox.h:498
@ backgroundColourId
Definition juce_ListBox.h:494
@ outlineColourId
Definition juce_ListBox.h:496
Definition juce_LookAndFeel_V2.cpp:1924
Path toggledShape
Definition juce_LookAndFeel_V2.cpp:1982
void paintButton(Graphics &g, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Definition juce_LookAndFeel_V2.cpp:1937
Colour colour
Definition juce_LookAndFeel_V2.cpp:1981
GlassWindowButton(const String &name, Colour col, const Path &normalShape_, const Path &toggledShape_) noexcept
Definition juce_LookAndFeel_V2.cpp:1926
Path normalShape
Definition juce_LookAndFeel_V2.cpp:1982
Definition juce_LookAndFeel_V2.cpp:1603
void mouseWheelMove(const MouseEvent &, const MouseWheelDetails &) override
Definition juce_LookAndFeel_V2.cpp:1607
std::unique_ptr< AccessibilityHandler > createAccessibilityHandler() override
Definition juce_LookAndFeel_V2.cpp:1609
SliderLabelComp()
Definition juce_LookAndFeel_V2.cpp:1605
void drawButtonBackground(Graphics &, Button &, const Colour &backgroundColour, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Definition juce_LookAndFeel_V2.cpp:245
ImageEffectFilter * getSliderEffect(Slider &) override
Definition juce_LookAndFeel_V2.cpp:1639
void drawSpinningWaitAnimation(Graphics &, const Colour &colour, int x, int y, int w, int h) override
Definition juce_LookAndFeel_V2.cpp:618
void drawRotarySlider(Graphics &, int x, int y, int width, int height, float sliderPosProportional, float rotaryStartAngle, float rotaryEndAngle, Slider &) override
Definition juce_LookAndFeel_V2.cpp:1530
void drawTabAreaBehindFrontButton(TabbedButtonBar &, Graphics &, int w, int h) override
Definition juce_LookAndFeel_V2.cpp:2380
void drawTabbedButtonBarBackground(TabbedButtonBar &, Graphics &) override
Definition juce_LookAndFeel_V2.cpp:2378
void drawMenuBarBackground(Graphics &, int width, int height, bool isMouseOverBar, MenuBarComponent &) override
Definition juce_LookAndFeel_V2.cpp:1111
std::unique_ptr< DropShadower > createDropShadowerForComponent(Component &) override
Definition juce_LookAndFeel_V2.cpp:2066
void preparePopupMenuWindow(Component &) override
Definition juce_LookAndFeel_V2.cpp:1163
void drawConcertinaPanelHeader(Graphics &, const Rectangle< int > &area, bool isMouseOver, bool isMouseDown, ConcertinaPanel &, Component &panel) override
Definition juce_LookAndFeel_V2.cpp:1776
void drawProgressBar(Graphics &, ProgressBar &, int width, int height, double progress, const String &textToShow) override
Definition juce_LookAndFeel_V2.cpp:559
void drawPopupMenuBackgroundWithOptions(Graphics &, int width, int height, const PopupMenu::Options &) override
Definition juce_LookAndFeel_V2.cpp:930
BorderSize< int > getLabelBorderSize(Label &) override
Definition juce_LookAndFeel_V2.cpp:1353
void drawToggleButton(Graphics &, ToggleButton &, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Definition juce_LookAndFeel_V2.cpp:345
float getCallOutBoxCornerSize(const CallOutBox &) override
Definition juce_LookAndFeel_V2.cpp:2648
void drawStretchableLayoutResizerBar(Graphics &, int w, int h, bool isVerticalBar, bool isMouseOver, bool isMouseDragging) override
Definition juce_LookAndFeel_V2.cpp:2091
PopupMenu::Options getOptionsForComboBoxPopupMenu(ComboBox &, Label &) override
Definition juce_LookAndFeel_V2.cpp:1294
Font getSliderPopupFont(Slider &) override
Definition juce_LookAndFeel_V2.cpp:1644
int getAlertWindowButtonHeight() override
Definition juce_LookAndFeel_V2.cpp:537
static void drawGlassLozenge(Graphics &, float x, float y, float width, float height, const Colour &, float outlineThickness, float cornerSize, bool flatOnLeft, bool flatOnRight, bool flatOnTop, bool flatOnBottom) noexcept
Definition juce_LookAndFeel_V2.cpp:3090
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_V2.cpp:691
void layoutFileBrowserComponent(FileBrowserComponent &, DirectoryContentsDisplayComponent *, FilePreviewComponent *, ComboBox *currentPathBox, TextEditor *filenameBox, Button *goUpButton) override
Definition juce_LookAndFeel_V2.cpp:2754
bool shouldPopupMenuScaleWithTargetComponent(const PopupMenu::Options &options) override
Definition juce_LookAndFeel_V2.cpp:1165
void fillTextEditorBackground(Graphics &, int width, int height, TextEditor &) override
Definition juce_LookAndFeel_V2.cpp:1184
void drawTreeviewPlusMinusBox(Graphics &, const Rectangle< float > &area, Colour backgroundColour, bool isOpen, bool isMouseOver) override
Definition juce_LookAndFeel_V2.cpp:823
void drawPopupMenuColumnSeparatorWithOptions(Graphics &g, const Rectangle< int > &bounds, const PopupMenu::Options &) override
Definition juce_LookAndFeel_V2.cpp:1174
void changeToggleButtonWidthToFitText(ToggleButton &) override
Definition juce_LookAndFeel_V2.cpp:376
Font getSidePanelTitleFont(SidePanel &) override
Definition juce_LookAndFeel_V2.cpp:2929
void drawComboBox(Graphics &, int width, int height, bool isMouseButtonDown, int buttonX, int buttonY, int buttonW, int buttonH, ComboBox &) override
Definition juce_LookAndFeel_V2.cpp:1222
void getIdealPopupMenuItemSize(const String &text, bool isSeparator, int standardMenuItemHeight, int &idealWidth, int &idealHeight) override
Definition juce_LookAndFeel_V2.cpp:880
void paintToolbarButtonLabel(Graphics &, int x, int y, int width, int height, const String &text, ToolbarItemComponent &) override
Definition juce_LookAndFeel_V2.cpp:2559
void drawMenuBarItem(Graphics &, int width, int height, int itemIndex, const String &itemText, bool isMouseOverItem, bool isMenuOpen, bool isMouseOverBar, MenuBarComponent &) override
Definition juce_LookAndFeel_V2.cpp:1134
void drawPopupMenuBackground(Graphics &, int width, int height) override
Definition juce_LookAndFeel_V2.cpp:914
void drawTableHeaderBackground(Graphics &, TableHeaderComponent &) override
Definition juce_LookAndFeel_V2.cpp:2466
int getSliderThumbRadius(Slider &) override
Definition juce_LookAndFeel_V2.cpp:1523
void positionComboBoxText(ComboBox &, Label &) override
Definition juce_LookAndFeel_V2.cpp:1285
Font getAlertWindowFont() override
Definition juce_LookAndFeel_V2.cpp:553
void fillResizableWindowBackground(Graphics &, int w, int h, const BorderSize< int > &, ResizableWindow &) override
Definition juce_LookAndFeel_V2.cpp:1861
void drawScrollbarButton(Graphics &, ScrollBar &, int width, int height, int buttonDirection, bool isScrollbarVertical, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Definition juce_LookAndFeel_V2.cpp:652
void drawLasso(Graphics &, Component &) override
Definition juce_LookAndFeel_V2.cpp:2521
Font getMenuBarFont(MenuBarComponent &, int itemIndex, const String &itemText) override
Definition juce_LookAndFeel_V2.cpp:1123
void drawAlertBox(Graphics &, AlertWindow &, const Rectangle< int > &textArea, TextLayout &) override
Definition juce_LookAndFeel_V2.cpp:451
AlertWindow * createAlertWindow(const String &title, const String &message, const String &button1, const String &button2, const String &button3, MessageBoxIconType iconType, int numButtons, Component *associatedComponent) override
Definition juce_LookAndFeel_V2.cpp:415
void drawFileBrowserRow(Graphics &, int width, int height, const File &file, const String &filename, Image *icon, const String &fileSizeDescription, const String &fileTimeDescription, bool isDirectory, bool isItemSelected, int itemIndex, DirectoryContentsDisplayComponent &) override
Definition juce_LookAndFeel_V2.cpp:2667
Component * getParentComponentForMenuOptions(const PopupMenu::Options &options) override
Definition juce_LookAndFeel_V2.cpp:1158
int getCallOutBoxBorderSize(const CallOutBox &) override
Definition juce_LookAndFeel_V2.cpp:2643
std::unique_ptr< FocusOutline > createFocusOutlineForComponent(Component &) override
Definition juce_LookAndFeel_V2.cpp:2071
Font getTextButtonFont(TextButton &, int buttonHeight) override
Definition juce_LookAndFeel_V2.cpp:280
void drawTableHeaderColumn(Graphics &, TableHeaderComponent &, const String &columnName, int columnId, int width, int height, bool isMouseOver, bool isMouseDown, int columnFlags) override
Definition juce_LookAndFeel_V2.cpp:2489
const Drawable * getDefaultFolderImage() override
Definition juce_LookAndFeel_V2.cpp:2800
int getDefaultMenuBarHeight() override
Definition juce_LookAndFeel_V2.cpp:2060
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_V2.cpp:1359
Button * createFilenameComponentBrowseButton(const String &text) override
Definition juce_LookAndFeel_V2.cpp:1754
int getTabButtonSpaceAroundImage() override
Definition juce_LookAndFeel_V2.cpp:2184
void drawButtonText(Graphics &, TextButton &, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Definition juce_LookAndFeel_V2.cpp:290
Font getComboBoxFont(ComboBox &) override
Definition juce_LookAndFeel_V2.cpp:1275
void getIdealPopupMenuItemSizeWithOptions(const String &text, bool isSeparator, int standardMenuItemHeight, int &idealWidth, int &idealHeight, const PopupMenu::Options &) override
Definition juce_LookAndFeel_V2.cpp:900
Button * createFileBrowserGoUpButton() override
Definition juce_LookAndFeel_V2.cpp:2738
Rectangle< int > getPropertyComponentContentPosition(PropertyComponent &) override
Definition juce_LookAndFeel_V2.cpp:2610
Rectangle< int > getTooltipBounds(const String &tipText, Point< int > screenPos, Rectangle< int > parentArea) override
Definition juce_LookAndFeel_V2.cpp:1727
Font getAlertWindowMessageFont() override
Definition juce_LookAndFeel_V2.cpp:548
void drawTooltip(Graphics &, const String &text, int width, int height) override
Definition juce_LookAndFeel_V2.cpp:1740
bool isProgressBarOpaque(ProgressBar &) override
Definition juce_LookAndFeel_V2.cpp:642
void drawPopupMenuUpDownArrow(Graphics &, int width, int height, bool isScrollUpArrow) override
Definition juce_LookAndFeel_V2.cpp:938
void drawTabButtonText(TabBarButton &, Graphics &, bool isMouseOver, bool isMouseDown) override
Definition juce_LookAndFeel_V2.cpp:2316
void drawPropertyComponentLabel(Graphics &, int width, int height, PropertyComponent &) override
Definition juce_LookAndFeel_V2.cpp:2596
Button * createSliderButton(Slider &, bool isIncrement) override
Definition juce_LookAndFeel_V2.cpp:1597
Label * createComboBoxTextBox(ComboBox &) override
Definition juce_LookAndFeel_V2.cpp:1280
void drawBubble(Graphics &, BubbleComponent &, const Point< float > &tip, const Rectangle< float > &body) override
Definition juce_LookAndFeel_V2.cpp:859
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
void fillTabButtonShape(TabBarButton &, Graphics &, const Path &, bool isMouseOver, bool isMouseDown) override
Definition juce_LookAndFeel_V2.cpp:2293
int getScrollbarButtonSize(ScrollBar &) override
Definition juce_LookAndFeel_V2.cpp:816
std::unique_ptr< Drawable > documentImage
Definition juce_LookAndFeel_V2.h:414
int getPopupMenuColumnSeparatorWidthWithOptions(const PopupMenu::Options &) override
Definition juce_LookAndFeel_V2.cpp:1178
int getTextButtonWidthToFitText(TextButton &, int buttonHeight) override
Definition juce_LookAndFeel_V2.cpp:285
int getPopupMenuBorderSize() override
Definition juce_LookAndFeel_V2.cpp:1167
LookAndFeel_V2()
Definition juce_LookAndFeel_V2.cpp:61
Button * createTabBarExtrasButton() override
Definition juce_LookAndFeel_V2.cpp:2426
Rectangle< int > getTabButtonExtraComponentBounds(const TabBarButton &, Rectangle< int > &textArea, Component &extraComp) override
Definition juce_LookAndFeel_V2.cpp:2201
void drawShinyButtonShape(Graphics &, float x, float y, float w, float h, float maxCornerSize, const Colour &, float strokeWidth, bool flatOnLeft, bool flatOnRight, bool flatOnTop, bool flatOnBottom) noexcept
Definition juce_LookAndFeel_V2.cpp:2973
static void drawGlassPointer(Graphics &, float x, float y, float diameter, const Colour &, float outlineThickness, int direction) noexcept
Definition juce_LookAndFeel_V2.cpp:3044
bool areLinesDrawnForTreeView(TreeView &) override
Definition juce_LookAndFeel_V2.cpp:848
Label * createSliderTextBox(Slider &) override
Definition juce_LookAndFeel_V2.cpp:1615
void drawLabel(Graphics &, Label &) override
Definition juce_LookAndFeel_V2.cpp:1325
ImageEffectFilter * getScrollbarEffect() override
Definition juce_LookAndFeel_V2.cpp:801
AttributedString createFileChooserHeaderText(const String &title, const String &instructions) override
Definition juce_LookAndFeel_V2.cpp:2654
void drawTabButton(TabBarButton &, Graphics &, bool isMouseOver, bool isMouseDown) override
Definition juce_LookAndFeel_V2.cpp:2363
void drawPopupMenuUpDownArrowWithOptions(Graphics &, int width, int height, bool isScrollUpArrow, const PopupMenu::Options &) override
Definition juce_LookAndFeel_V2.cpp:963
void drawPropertyPanelSectionHeader(Graphics &, const String &name, bool isOpen, int width, int height) override
Definition juce_LookAndFeel_V2.cpp:2575
Path getCrossShape(float height) override
Definition juce_LookAndFeel_V2.cpp:2839
int getSliderPopupPlacement(Slider &) override
Definition juce_LookAndFeel_V2.cpp:1649
Array< int > getWidthsForTextButtons(AlertWindow &, const Array< TextButton * > &) override
Definition juce_LookAndFeel_V2.cpp:524
int getPopupMenuBorderSizeWithOptions(const PopupMenu::Options &) override
Definition juce_LookAndFeel_V2.cpp:1169
bool areScrollbarButtonsVisible() override
Definition juce_LookAndFeel_V2.cpp:647
void drawDrawableButton(Graphics &, DrawableButton &, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Definition juce_LookAndFeel_V2.cpp:387
static void drawBevel(Graphics &, int x, int y, int width, int height, int bevelThickness, const Colour &topLeftColour=Colours::white, const Colour &bottomRightColour=Colours::black, bool useGradient=true, bool sharpEdgeOnOutside=true)
Definition juce_LookAndFeel_V2.cpp:2946
void drawTickBox(Graphics &, Component &, float x, float y, float w, float h, bool ticked, bool isEnabled, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Definition juce_LookAndFeel_V2.cpp:313
void drawPropertyComponentBackground(Graphics &, int width, int height, PropertyComponent &) override
Definition juce_LookAndFeel_V2.cpp:2590
void drawPopupMenuItemWithOptions(Graphics &, const Rectangle< int > &area, bool isHighlighted, const PopupMenu::Item &item, const PopupMenu::Options &) override
Definition juce_LookAndFeel_V2.cpp:1064
int getMinimumScrollbarThumbSize(ScrollBar &) override
Definition juce_LookAndFeel_V2.cpp:806
int getDefaultScrollbarWidth() override
Definition juce_LookAndFeel_V2.cpp:811
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_V2.cpp:1489
void positionDocumentWindowButtons(DocumentWindow &, int titleBarX, int titleBarY, int titleBarW, int titleBarH, Button *minimiseButton, Button *maximiseButton, Button *closeButton, bool positionTitleBarButtonsOnLeft) override
Definition juce_LookAndFeel_V2.cpp:2028
void paintToolbarBackground(Graphics &, int width, int height, Toolbar &) override
Definition juce_LookAndFeel_V2.cpp:2532
Button * createToolbarMissingItemsButton(Toolbar &) override
Definition juce_LookAndFeel_V2.cpp:2544
void drawCornerResizer(Graphics &, int w, int h, bool isMouseOver, bool isMouseDragging) override
Definition juce_LookAndFeel_V2.cpp:1817
void drawImageButton(Graphics &, Image *, int imageX, int imageY, int imageW, int imageH, const Colour &overlayColour, float imageOpacity, ImageButton &) override
Definition juce_LookAndFeel_V2.cpp:1790
void drawGroupComponentOutline(Graphics &, int w, int h, const String &text, const Justification &, GroupComponent &) override
Definition juce_LookAndFeel_V2.cpp:2116
void drawCallOutBoxBackground(CallOutBox &, Graphics &, const Path &path, Image &cachedImage) override
Definition juce_LookAndFeel_V2.cpp:2622
void drawDocumentWindowTitleBar(DocumentWindow &, Graphics &, int w, int h, int titleSpaceX, int titleSpaceW, const Image *icon, bool drawTitleTextOnLeft) override
Definition juce_LookAndFeel_V2.cpp:1872
Path getTickShape(float height) override
Definition juce_LookAndFeel_V2.cpp:2825
void drawTextEditorOutline(Graphics &, int width, int height, TextEditor &) override
Definition juce_LookAndFeel_V2.cpp:1189
void drawResizableWindowBorder(Graphics &, int w, int h, const BorderSize< int > &border, ResizableWindow &) override
Definition juce_LookAndFeel_V2.cpp:1867
void drawResizableFrame(Graphics &, int w, int h, const BorderSize< int > &) override
Definition juce_LookAndFeel_V2.cpp:1841
void layoutFilenameComponent(FilenameComponent &, ComboBox *filenameBox, Button *browseButton) override
Definition juce_LookAndFeel_V2.cpp:1759
void drawPopupMenuSectionHeaderWithOptions(Graphics &, const Rectangle< int > &area, const String &sectionName, const PopupMenu::Options &) override
Definition juce_LookAndFeel_V2.cpp:1098
void drawComboBoxTextWhenNothingSelected(Graphics &, ComboBox &, Label &) override
Definition juce_LookAndFeel_V2.cpp:1304
int getTreeViewIndentSize(TreeView &) override
Definition juce_LookAndFeel_V2.cpp:853
Font getTabButtonFont(TabBarButton &, float height) override
Definition juce_LookAndFeel_V2.cpp:2311
Font getAlertWindowTitleFont() override
Definition juce_LookAndFeel_V2.cpp:542
Font getLabelFont(Label &) override
Definition juce_LookAndFeel_V2.cpp:1320
int getTabButtonBestWidth(TabBarButton &, int tabDepth) override
Definition juce_LookAndFeel_V2.cpp:2189
Slider::SliderLayout getSliderLayout(Slider &) override
Definition juce_LookAndFeel_V2.cpp:1658
Button * createDocumentWindowButton(int buttonType) override
Definition juce_LookAndFeel_V2.cpp:1987
void drawPopupMenuItem(Graphics &, const Rectangle< int > &area, bool isSeparator, bool isActive, bool isHighlighted, bool isTicked, bool hasSubMenu, const String &text, const String &shortcutKeyText, const Drawable *icon, const Colour *textColour) override
Definition juce_LookAndFeel_V2.cpp:971
void paintToolbarButtonBackground(Graphics &, int width, int height, bool isMouseOver, bool isMouseDown, ToolbarItemComponent &) override
Definition juce_LookAndFeel_V2.cpp:2549
int getMenuWindowFlags() override
Definition juce_LookAndFeel_V2.cpp:1106
~LookAndFeel_V2() override
Definition juce_LookAndFeel_V2.cpp:242
void createTabButtonShape(TabBarButton &, Path &, bool isMouseOver, bool isMouseDown) override
Definition juce_LookAndFeel_V2.cpp:2233
static void drawGlassSphere(Graphics &, float x, float y, float diameter, const Colour &, float outlineThickness) noexcept
Definition juce_LookAndFeel_V2.cpp:3004
std::unique_ptr< Drawable > folderImage
Definition juce_LookAndFeel_V2.h:414
const Drawable * getDefaultDocumentFileImage() override
Definition juce_LookAndFeel_V2.cpp:2808
int getMenuBarItemWidth(MenuBarComponent &, int itemIndex, const String &itemText) override
Definition juce_LookAndFeel_V2.cpp:1128
int getTabButtonOverlap(int tabDepth) override
Definition juce_LookAndFeel_V2.cpp:2179
Font getPopupMenuFont() override
Definition juce_LookAndFeel_V2.cpp:875
CaretComponent * createCaretComponent(Component *keyFocusOwner) override
Definition juce_LookAndFeel_V2.cpp:1216
void drawPopupMenuSectionHeader(Graphics &, const Rectangle< int > &area, const String &sectionName) override
Definition juce_LookAndFeel_V2.cpp:1086
int getAlertBoxWindowFlags() override
Definition juce_LookAndFeel_V2.cpp:518
int getPropertyPanelSectionHeaderHeight(const String &sectionTitle) override
Definition juce_LookAndFeel_V2.cpp:2616
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_MouseEvent.h:39
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 addPieSegment(float x, float y, float width, float height, float fromRadians, float toRadians, float innerCircleProportionalSize)
Definition juce_Path.cpp:525
void addTriangle(float x1, float y1, float x2, float y2, float x3, float y3)
Definition juce_Path.cpp:417
void addEllipse(float x, float y, float width, float height)
Definition juce_Path.cpp:446
AffineTransform getTransformToScaleToFit(float x, float y, float width, float height, bool preserveProportions, Justification justificationType=Justification::centred) const
Definition juce_Path.cpp:885
void addRectangle(float x, float y, float width, float height)
Definition juce_Path.cpp:323
void applyTransform(const AffineTransform &transform) noexcept
Definition juce_Path.cpp:821
void closeSubPath()
Definition juce_Path.cpp:292
void lineTo(float endX, float endY)
Definition juce_Path.cpp:233
Path createPathWithRoundedCorners(float cornerRadius) const
Definition juce_Path.cpp:1075
void addLineSegment(Line< float > line, float lineThickness)
Definition juce_Path.cpp:581
void addArrow(Line< float > line, float lineThickness, float arrowheadWidth, float arrowheadLength)
Definition juce_Path.cpp:593
void setUsingNonZeroWinding(bool isNonZeroWinding) noexcept
Definition juce_Path.cpp:168
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
ValueType y
Definition juce_Point.h:247
ValueType x
Definition juce_Point.h:246
Definition juce_PopupMenu.h:457
Component * getParentComponent() const noexcept
Definition juce_PopupMenu.h:570
JUCE_NODISCARD Options withStandardItemHeight(int standardHeight) const
Definition juce_PopupMenu.cpp:2004
JUCE_NODISCARD Options withMaximumNumColumns(int maxNumColumns) const
Definition juce_PopupMenu.cpp:1999
JUCE_NODISCARD Options withMinimumWidth(int minWidth) const
Definition juce_PopupMenu.cpp:1989
JUCE_NODISCARD Options withTargetComponent(Component *targetComponent) const
Definition juce_PopupMenu.cpp:1957
JUCE_NODISCARD Options withItemThatMustBeVisible(int idOfItemToBeVisible) const
Definition juce_PopupMenu.cpp:2009
JUCE_NODISCARD Options withInitiallySelectedItem(int idOfItemToBeSelected) const
Definition juce_PopupMenu.cpp:2024
@ headerTextColourId
Definition juce_PopupMenu.h:763
@ highlightedTextColourId
Definition juce_PopupMenu.h:767
@ backgroundColourId
Definition juce_PopupMenu.h:760
@ highlightedBackgroundColourId
Definition juce_PopupMenu.h:765
@ textColourId
Definition juce_PopupMenu.h:761
Definition juce_ProgressBar.h:51
@ backgroundColourId
Definition juce_ProgressBar.h:95
@ foregroundColourId
Definition juce_ProgressBar.h:96
Definition juce_PropertyComponent.h:49
@ labelTextColourId
Definition juce_PropertyComponent.h:118
@ backgroundColourId
Definition juce_PropertyComponent.h:117
Definition juce_Rectangle.h:67
ValueType getRight() const noexcept
Definition juce_Rectangle.h:139
void setHeight(ValueType newHeight) noexcept
Definition juce_Rectangle.h:204
Rectangle< float > toFloat() const noexcept
Definition juce_Rectangle.h:873
Rectangle removeFromRight(ValueType amountToRemove) noexcept
Definition juce_Rectangle.h:542
ValueType getCentreX() const noexcept
Definition juce_Rectangle.h:145
Rectangle removeFromBottom(ValueType amountToRemove) noexcept
Definition juce_Rectangle.h:559
ValueType getHeight() const noexcept
Definition juce_Rectangle.h:136
ValueType getCentreY() const noexcept
Definition juce_Rectangle.h:148
Rectangle constrainedWithin(Rectangle areaToFitWithin) const noexcept
Definition juce_Rectangle.h:798
void setWidth(ValueType newWidth) noexcept
Definition juce_Rectangle.h:201
ValueType getBottom() const noexcept
Definition juce_Rectangle.h:142
ValueType getX() const noexcept
Definition juce_Rectangle.h:127
Rectangle removeFromTop(ValueType amountToRemove) noexcept
Definition juce_Rectangle.h:510
Rectangle getUnion(Rectangle other) const noexcept
Definition juce_Rectangle.h:719
ValueType getWidth() const noexcept
Definition juce_Rectangle.h:133
void setX(ValueType newX) noexcept
Definition juce_Rectangle.h:195
Rectangle reduced(ValueType deltaX, ValueType deltaY) const noexcept
Definition juce_Rectangle.h:485
Rectangle removeFromLeft(ValueType amountToRemove) noexcept
Definition juce_Rectangle.h:526
void setY(ValueType newY) noexcept
Definition juce_Rectangle.h:198
ValueType getY() const noexcept
Definition juce_Rectangle.h:130
void reduce(ValueType deltaX, ValueType deltaY) noexcept
Definition juce_Rectangle.h:474
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_RectanglePlacement.h:40
AffineTransform getTransformToFit(const Rectangle< float > &source, const Rectangle< float > &destination) const noexcept
Definition juce_RectanglePlacement.cpp:82
@ onlyReduceInSize
Definition juce_RectanglePlacement.h:106
@ centred
Definition juce_RectanglePlacement.h:119
@ stretchToFit
Definition juce_RectanglePlacement.h:90
Definition juce_ResizableWindow.h:52
@ backgroundColourId
Definition juce_ResizableWindow.h:312
Definition juce_ScrollBar.h:54
bool isVertical() const noexcept
Definition juce_ScrollBar.h:67
@ thumbColourId
Definition juce_ScrollBar.h:295
@ trackColourId
Definition juce_ScrollBar.h:296
@ backgroundColourId
Definition juce_ScrollBar.h:294
Definition juce_SidePanel.h:44
@ titleTextColour
Definition juce_SidePanel.h:171
@ dismissButtonOverColour
Definition juce_SidePanel.h:174
@ dismissButtonDownColour
Definition juce_SidePanel.h:175
@ shadowBaseColour
Definition juce_SidePanel.h:172
@ backgroundColour
Definition juce_SidePanel.h:170
@ dismissButtonNormalColour
Definition juce_SidePanel.h:173
Definition juce_Slider.h:54
SliderStyle
Definition juce_Slider.h:62
@ LinearBarVertical
Definition juce_Slider.h:66
@ ThreeValueHorizontal
Definition juce_Slider.h:82
@ TwoValueHorizontal
Definition juce_Slider.h:77
@ LinearBar
Definition juce_Slider.h:65
@ LinearHorizontal
Definition juce_Slider.h:63
@ LinearVertical
Definition juce_Slider.h:64
@ ThreeValueVertical
Definition juce_Slider.h:85
@ TwoValueVertical
Definition juce_Slider.h:79
@ textBoxBackgroundColourId
Definition juce_Slider.h:874
@ textBoxTextColourId
Definition juce_Slider.h:873
@ rotarySliderFillColourId
Definition juce_Slider.h:870
@ textBoxHighlightColourId
Definition juce_Slider.h:875
@ textBoxOutlineColourId
Definition juce_Slider.h:876
@ trackColourId
Definition juce_Slider.h:869
@ backgroundColourId
Definition juce_Slider.h:866
@ rotarySliderOutlineColourId
Definition juce_Slider.h:871
@ thumbColourId
Definition juce_Slider.h:867
@ TextBoxRight
Definition juce_Slider.h:97
@ NoTextBox
Definition juce_Slider.h:95
@ TextBoxAbove
Definition juce_Slider.h:98
@ TextBoxBelow
Definition juce_Slider.h:99
@ TextBoxLeft
Definition juce_Slider.h:96
Definition juce_String.h:53
bool isEmpty() const noexcept
Definition juce_String.h:310
static String charToString(juce_wchar character)
Definition juce_String.cpp:359
bool isNotEmpty() const noexcept
Definition juce_String.h:316
Definition juce_TabbedButtonBar.h:44
@ beforeText
Definition juce_TabbedButtonBar.h:61
Definition juce_TabbedButtonBar.h:155
Orientation getOrientation() const noexcept
Definition juce_TabbedButtonBar.h:190
@ TabsAtLeft
Definition juce_TabbedButtonBar.h:165
@ TabsAtTop
Definition juce_TabbedButtonBar.h:163
@ TabsAtBottom
Definition juce_TabbedButtonBar.h:164
@ TabsAtRight
Definition juce_TabbedButtonBar.h:166
@ tabOutlineColourId
Definition juce_TabbedButtonBar.h:296
@ frontTextColourId
Definition juce_TabbedButtonBar.h:300
@ tabTextColourId
Definition juce_TabbedButtonBar.h:297
@ frontOutlineColourId
Definition juce_TabbedButtonBar.h:299
@ outlineColourId
Definition juce_TabbedComponent.h:189
@ backgroundColourId
Definition juce_TabbedComponent.h:188
Definition juce_TableHeaderComponent.h:47
@ backgroundColourId
Definition juce_TableHeaderComponent.h:378
@ highlightColourId
Definition juce_TableHeaderComponent.h:381
@ textColourId
Definition juce_TableHeaderComponent.h:377
@ outlineColourId
Definition juce_TableHeaderComponent.h:380
int getNumColumns(bool onlyCountVisibleColumns) const
Definition juce_TableHeaderComponent.cpp:70
@ sortedForwards
Definition juce_TableHeaderComponent.h:68
@ sortedBackwards
Definition juce_TableHeaderComponent.h:69
Rectangle< int > getColumnPosition(int index) const
Definition juce_TableHeaderComponent.cpp:237
Definition juce_TextButton.h:39
@ textColourOnId
Definition juce_TextButton.h:80
@ buttonColourId
Definition juce_TextButton.h:73
@ buttonOnColourId
Definition juce_TextButton.h:76
@ textColourOffId
Definition juce_TextButton.h:79
Definition juce_TextEditor.h:43
@ backgroundColourId
Definition juce_TextEditor.h:209
@ highlightColourId
Definition juce_TextEditor.h:217
@ textColourId
Definition juce_TextEditor.h:212
@ outlineColourId
Definition juce_TextEditor.h:223
@ highlightedTextColourId
Definition juce_TextEditor.h:221
@ focusedOutlineColourId
Definition juce_TextEditor.h:226
@ shadowColourId
Definition juce_TextEditor.h:229
bool isReadOnly() const noexcept
Definition juce_TextEditor.cpp:1042
@ decimalKeyboard
Definition juce_TextInputTarget.h:84
Definition juce_TextLayout.h:41
void createLayoutWithBalancedLineLengths(const AttributedString &, float maxWidth)
Definition juce_TextLayout.cpp:261
float getWidth() const noexcept
Definition juce_TextLayout.h:223
void draw(Graphics &, Rectangle< float > area) const
Definition juce_TextLayout.cpp:197
float getHeight() const noexcept
Definition juce_TextLayout.h:226
@ backgroundColourId
Definition juce_TextPropertyComponent.h:121
@ outlineColourId
Definition juce_TextPropertyComponent.h:123
@ textColourId
Definition juce_TextPropertyComponent.h:122
static uint32 getMillisecondCounter() noexcept
Definition juce_Time.cpp:241
Definition juce_ToggleButton.h:41
@ tickDisabledColourId
Definition juce_ToggleButton.h:76
@ textColourId
Definition juce_ToggleButton.h:74
@ tickColourId
Definition juce_ToggleButton.h:75
Definition juce_Toolbar.h:55
@ backgroundColourId
Definition juce_Toolbar.h:237
@ editingModeOutlineColourId
Definition juce_Toolbar.h:249
@ buttonMouseOverBackgroundColourId
Definition juce_Toolbar.h:241
@ labelTextColourId
Definition juce_Toolbar.h:246
@ separatorColourId
Definition juce_Toolbar.h:239
@ buttonMouseDownBackgroundColourId
Definition juce_Toolbar.h:243
bool isVertical() const noexcept
Definition juce_Toolbar.h:84
Definition juce_ToolbarItemComponent.h:50
@ textColourId
Definition juce_TooltipWindow.h:115
@ outlineColourId
Definition juce_TooltipWindow.h:116
@ backgroundColourId
Definition juce_TooltipWindow.h:114
Definition juce_TreeView.h:657
@ dragAndDropIndicatorColourId
Definition juce_TreeView.h:872
@ oddItemsColourId
Definition juce_TreeView.h:874
@ linesColourId
Definition juce_TreeView.h:871
@ evenItemsColourId
Definition juce_TreeView.h:875
@ selectedItemBackgroundColourId
Definition juce_TreeView.h:873
@ backgroundColourId
Definition juce_TreeView.h:870
UINT_D64 w
Definition inflate.c:942
int * l
Definition inflate.c:1579
struct huft * t
Definition inflate.c:943
int y
Definition inflate.c:1588
unsigned d
Definition inflate.c:940
int g
Definition inflate.c:1573
register unsigned i
Definition inflate.c:1575
static ZCONST unsigned border[]
Definition inflate.c:749
unsigned s
Definition inflate.c:1555
unsigned x[BMAX+1]
Definition inflate.c:1586
unsigned f
Definition inflate.c:1572
static char filename[]
Definition features.c:5
static const char * title
Definition pugl.h:1747
static const char * name
Definition pugl.h:1582
static int int height
Definition pugl.h:1594
static int width
Definition pugl.h:1593
JSAMPIMAGE data
Definition jpeglib.h:945
#define TRANS(stringLiteral)
Definition juce_LocalisedStrings.h:208
#define jassert(expression)
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
#define jassertfalse
static const SerdStyle style
Definition sratom.c:36
static int JUCE_CDECL comp(const void *a, const void *b)
Definition lsp.c:298
std::string indent(const std::string &src, const std::string &indent)
Indent a string by another string (prefix each line).
Definition utils.cpp:135
const Colour transparentBlack
Definition juce_Colours.h:40
const Colour lightgrey
Definition juce_Colours.h:111
const Colour red
Definition juce_Colours.h:157
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 lightblue
Definition juce_Colours.h:106
const Colour transparentWhite
Definition juce_Colours.h:41
const Colour white
Definition juce_Colours.h:180
const Colour blue
Definition juce_Colours.h:52
const Colour yellow
Definition juce_Colours.h:182
Definition juce_LookAndFeel_V2.cpp:30
static Colour createBaseColour(Colour buttonColour, bool hasKeyboardFocus, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) noexcept
Definition juce_LookAndFeel_V2.cpp:31
static TextLayout layoutTooltipText(const String &text, Colour colour) noexcept
Definition juce_LookAndFeel_V2.cpp:45
Definition carla_juce.cpp:31
static Path createPathFromData(float height, const unsigned char *data, size_t size)
Definition juce_LookAndFeel_V2.cpp:2817
constexpr Type jmin(Type a, Type b)
Definition juce_MathsFunctions.h:106
unsigned int uint32
Definition juce_MathsFunctions.h:45
constexpr Type jmax(Type a, Type b)
Definition juce_MathsFunctions.h:94
MessageBoxIconType
Definition juce_MessageBoxOptions.h:31
@ WarningIcon
Definition juce_MessageBoxOptions.h:35
@ NoIcon
Definition juce_MessageBoxOptions.h:32
@ InfoIcon
Definition juce_MessageBoxOptions.h:37
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Definition juce_MathsFunctions.h:262
static std::unique_ptr< Drawable > createDrawableFromSVG(const char *data)
Definition juce_LookAndFeel_V2.cpp:2793
wchar_t juce_wchar
Definition juce_CharacterFunctions.h:42
std::unique_ptr< XmlElement > parseXML(const String &textToParse)
Definition juce_XmlDocument.cpp:41
unsigned char uint8
Definition juce_MathsFunctions.h:37
int roundToInt(const FloatType value) noexcept
Definition juce_MathsFunctions.h:465
@ window
Definition juce_AccessibilityRole.h:63
@ slider
Definition juce_AccessibilityRole.h:43
@ menuBar
Definition juce_AccessibilityRole.h:48
@ image
Definition juce_AccessibilityRole.h:42
@ progressBar
Definition juce_AccessibilityRole.h:60
@ button
Definition juce_AccessibilityRole.h:38
@ label
Definition juce_AccessibilityRole.h:44
@ group
Definition juce_AccessibilityRole.h:61
constexpr int numElementsInArray(Type(&)[N]) noexcept
Definition juce_MathsFunctions.h:344
png_uint_32 length
Definition png.c:2247
Definition jquant2.c:258
Definition juce_DropShadowEffect.h:36
void drawForPath(Graphics &g, const Path &path) const
Definition juce_DropShadowEffect.cpp:92
Definition juce_FocusOutline.h:54
static constexpr FloatType halfPi
Definition juce_MathsFunctions.h:388
static constexpr FloatType twoPi
Definition juce_MathsFunctions.h:385
static constexpr FloatType pi
Definition juce_MathsFunctions.h:382
Definition juce_MouseEvent.h:392
Definition juce_PopupMenu.h:111
bool isTicked
Definition juce_PopupMenu.h:174
std::unique_ptr< Drawable > image
Definition juce_PopupMenu.h:146
String text
Definition juce_PopupMenu.h:130
std::unique_ptr< PopupMenu > subMenu
Definition juce_PopupMenu.h:143
int itemID
Definition juce_PopupMenu.h:137
bool isEnabled
Definition juce_PopupMenu.h:171
bool isSeparator
Definition juce_PopupMenu.h:177
String shortcutKeyDescription
Definition juce_PopupMenu.h:163
Colour colour
Definition juce_PopupMenu.h:168
Definition juce_Slider.h:884
Rectangle< int > textBoxBounds
Definition juce_Slider.h:886
Rectangle< int > sliderBounds
Definition juce_Slider.h:885
const char * text
Definition swell-functions.h:167
int n
Definition crypt.c:458
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
b
Definition crypt.c:628
ulg size
Definition extract.c:2350
typedef int(UZ_EXP MsgFn)()
ss
Definition zipinfo.c:2292