32 return palette[index];
48 for (
auto i = 0; i < numColours; ++i)
49 if (palette[i] !=
other.palette[i])
57 return ! operator== (
other);
80LookAndFeel_V4::ColourScheme LookAndFeel_V4::getDarkColourScheme()
82 return { 0xff323e44, 0xff263238, 0xff323e44,
83 0xff8e989b, 0xffffffff, 0xff42a2c8,
84 0xffffffff, 0xff181f22, 0xffffffff };
87LookAndFeel_V4::ColourScheme LookAndFeel_V4::getMidnightColourScheme()
89 return { 0xff2f2f3a, 0xff191926, 0xffd0d0d0,
90 0xff66667c, 0xc8ffffff, 0xffd8d8d8,
91 0xffffffff, 0xff606073, 0xff000000 };
94LookAndFeel_V4::ColourScheme LookAndFeel_V4::getGreyColourScheme()
96 return { 0xff505050, 0xff424242, 0xff606060,
97 0xffa6a6a6, 0xffffffff, 0xff21ba90,
98 0xff000000, 0xffffffff, 0xffffffff };
101LookAndFeel_V4::ColourScheme LookAndFeel_V4::getLightColourScheme()
103 return { 0xffefefef, 0xffffffff, 0xffffffff,
104 0xffdddddd, 0xff000000, 0xffa9a9a9,
105 0xffffffff, 0xff42a2c8, 0xff000000 };
113 :
Button (name), colour (c), normalShape (normal), toggledShape (
toggled)
119 auto background = Colours::grey;
123 background =
lf->getCurrentColourScheme().getUIColour (LookAndFeel_V4::ColourScheme::widgetBackground);
148 Path normalShape, toggledShape;
153Button* LookAndFeel_V4::createDocumentWindowButton (
int buttonType)
158 if (
buttonType == DocumentWindow::closeButton)
161 shape.addLineSegment ({ 1.0f, 0.0f, 0.0f, 1.0f },
crossThickness);
163 return new LookAndFeel_V4_DocumentWindowButton (
"close", Colour (0xff9A131D), shape, shape);
166 if (
buttonType == DocumentWindow::minimiseButton)
168 shape.addLineSegment ({ 0.0f, 0.5f, 1.0f, 0.5f },
crossThickness);
170 return new LookAndFeel_V4_DocumentWindowButton (
"minimise", Colour (0xffaa8811), shape, shape);
173 if (
buttonType == DocumentWindow::maximiseButton)
175 shape.addLineSegment ({ 0.5f, 0.0f, 0.5f, 1.0f },
crossThickness);
176 shape.addLineSegment ({ 0.0f, 0.5f, 1.0f, 0.5f },
crossThickness);
187 return new LookAndFeel_V4_DocumentWindowButton (
"maximise", Colour (0xff0A830A), shape,
fullscreenShape);
194void LookAndFeel_V4::positionDocumentWindowButtons (DocumentWindow&,
197 Button* minimiseButton,
198 Button* maximiseButton,
200 bool positionTitleBarButtonsOnLeft)
204 auto x = positionTitleBarButtonsOnLeft ?
titleBarX
207 if (closeButton !=
nullptr)
213 if (positionTitleBarButtonsOnLeft)
214 std::swap (minimiseButton, maximiseButton);
216 if (maximiseButton !=
nullptr)
222 if (minimiseButton !=
nullptr)
226void LookAndFeel_V4::drawDocumentWindowTitleBar (DocumentWindow& window, Graphics& g,
233 auto isActive = window.isActiveWindow();
235 g.setColour (getCurrentColourScheme().getUIColour (ColourScheme::widgetBackground));
241 auto textW = font.getStringWidth (window.getName());
247 iconH =
static_cast<int> (font.getHeight());
248 iconW = icon->getWidth() *
iconH / icon->getHeight() + 4;
260 g.setOpacity (isActive ? 1.0f : 0.6f);
270 g.setColour (getCurrentColourScheme().getUIColour (ColourScheme::defaultText));
276Font LookAndFeel_V4::getTextButtonFont (TextButton&,
int buttonHeight)
278 return {
jmin (16.0f, (
float) buttonHeight * 0.6f) };
281void LookAndFeel_V4::drawButtonBackground (Graphics& g,
283 const Colour& backgroundColour,
287 auto cornerSize = 6.0f;
288 auto bounds = button.getLocalBounds().toFloat().reduced (0.5f, 0.5f);
290 auto baseColour = backgroundColour.withMultipliedSaturation (button.hasKeyboardFocus (
true) ? 1.3f : 0.9f)
291 .withMultipliedAlpha (button.isEnabled() ? 1.0f : 0.5f);
300 auto flatOnTop = button.isConnectedOnTop();
306 path.addRoundedRectangle (bounds.getX(), bounds.getY(),
307 bounds.getWidth(), bounds.getHeight(),
308 cornerSize, cornerSize,
317 g.strokePath (path, PathStrokeType (1.0f));
321 g.fillRoundedRectangle (bounds, cornerSize);
324 g.drawRoundedRectangle (bounds, cornerSize, 1.0f);
331 auto fontSize =
jmin (15.0f, (
float) button.getHeight() * 0.75f);
334 drawTickBox (g, button, 4.0f, ((
float) button.getHeight() -
tickWidth) * 0.5f,
336 button.getToggleState(),
344 if (! button.isEnabled())
349 .withTrimmedRight (2),
354 float x,
float y,
float w,
float h,
373void LookAndFeel_V4::changeToggleButtonWidthToFitText (ToggleButton& button)
375 auto fontSize =
jmin (15.0f, (
float) button.getHeight() * 0.75f);
380 button.setSize (font.getStringWidth (button.getButtonText()) +
roundToInt (
tickWidth) + 14, button.getHeight());
384AlertWindow* LookAndFeel_V4::createAlertWindow (
const String& title,
const String& message,
387 int numButtons, Component* associatedComponent)
394 auto bounds =
aw->getBounds();
396 aw->setBounds (bounds);
398 for (
auto* child :
aw->getChildren())
400 button->setBounds (button->getBounds() + Point<
int> (25, 40));
405void LookAndFeel_V4::drawAlertBox (Graphics& g, AlertWindow&
alert,
406 const Rectangle<int>& textArea, TextLayout& textLayout)
408 auto cornerSize = 4.0f;
411 g.drawRoundedRectangle (
alert.getLocalBounds().toFloat(), cornerSize, 2.0f);
413 auto bounds =
alert.getLocalBounds().reduced (1);
414 g.reduceClipRegion (bounds);
417 g.fillRoundedRectangle (bounds.toFloat(), cornerSize);
424 if (
alert.containsAnyExtraComponents() ||
alert.getNumButtons() > 2)
441 static_cast<float> (
iconRect.getRight()),
static_cast<float> (
iconRect.getBottom()),
442 static_cast<float> (
iconRect.getX()),
static_cast<float> (
iconRect.getBottom()));
444 icon = icon.createPathWithRoundedCorners (5.0f);
449 colour = Colour (0xff00b0b9).withAlpha (0.4f).getARGB();
452 icon.addEllipse (
iconRect.toFloat());
459 static_cast<float> (
iconRect.getWidth()),
static_cast<float> (
iconRect.getHeight()),
461 ga.createPath (icon);
463 icon.setUsingNonZeroWinding (
false);
464 g.setColour (Colour (colour));
473 bounds.getWidth(), bounds.getHeight() - getAlertWindowButtonHeight() - 20);
478int LookAndFeel_V4::getAlertWindowButtonHeight() {
return 40; }
481Font LookAndFeel_V4::getAlertWindowFont() {
return { 14.0f }; }
485 int width,
int height,
double progress,
488 switch (progressBar.getResolvedStyle())
491 drawLinearProgressBar (g, progressBar, width, height, progress,
textToShow);
495 drawCircularProgressBar (g, progressBar,
textToShow);
507 int width,
int height,
double progress,
513 auto barBounds = progressBar.getLocalBounds().toFloat();
518 if (progress >= 0.0f && progress <= 1.0f)
541 x,
static_cast<float> (height),
542 x - (
float)
stripeWidth * 0.5f,
static_cast<float> (height));
549 g2.fillRoundedRectangle (
barBounds, (
float) progressBar.getHeight() * 0.5f);
559 g.
setFont ((
float) height * 0.6f);
565void LookAndFeel_V4::drawCircularProgressBar (Graphics& g,
const ProgressBar& progressBar,
571 const auto barBounds = progressBar.getLocalBounds().reduced (2, 2).toFloat();
595 g.setColour (background);
604 g.strokePath (
arcPath2, PathStrokeType (4.0f));
618 g.strokePath (
arcPath, PathStrokeType (4.0f));
645 g.
setColour (isMouseOver ? c.brighter (0.25f) : c);
652 static const unsigned char pathData[] = { 110,109,32,210,202,64,126,183,148,64,108,39,244,247,64,245,76,124,64,108,178,131,27,65,246,76,252,64,108,175,242,4,65,246,76,252,
653 64,108,236,5,68,65,0,0,160,180,108,240,150,90,65,21,136,52,63,108,48,59,16,65,0,0,32,65,108,32,210,202,64,126,183,148,64, 99,101,0,0 };
657 path.
scaleToFit (0, 0, height * 2.0f, height,
true);
664 static const unsigned char pathData[] = { 110,109,51,51,255,66,0,0,0,0,108,205,204,13,67,51,51,99,65,108,0,0,170,66,205,204,141,66,108,51,179,13,67,52,51,255,66,108,0,0,255,
665 66,205,204,13,67,108,205,204,141,66,0,0,170,66,108,52,51,99,65,51,179,13,67,108,0,0,0,0,51,51,255,66,108,205,204,98,66, 204,204,141,66,108,0,0,0,0,51,51,99,65,108,51,51,
666 99,65,0,0,0,0,108,205,204,141,66,205,204,98,66,108,51,51,255,66,0,0,0,0,99,101,0,0 };
670 path.
scaleToFit (0, 0, height * 2.0f, height,
true);
676void LookAndFeel_V4::fillTextEditorBackground (
Graphics& g,
int width,
int height,
TextEditor& textEditor)
688 LookAndFeel_V2::fillTextEditorBackground (g, width, height, textEditor);
692void LookAndFeel_V4::drawTextEditorOutline (Graphics& g,
int width,
int height, TextEditor& textEditor)
694 if (
dynamic_cast<AlertWindow*
> (textEditor.getParentComponent()) ==
nullptr)
696 if (textEditor.isEnabled())
698 if (textEditor.hasKeyboardFocus (
true) && ! textEditor.isReadOnly())
701 g.drawRect (0, 0, width, height, 2);
706 g.drawRect (0, 0, width, height);
713Button* LookAndFeel_V4::createFileBrowserGoUpButton()
718 arrowPath.addArrow ({ 50.0f, 100.0f, 50.0f, 0.0f }, 40.0f, 100.0f, 50.0f);
729void LookAndFeel_V4::layoutFileBrowserComponent (FileBrowserComponent&
browserComp,
730 DirectoryContentsDisplayComponent* fileListComponent,
731 FilePreviewComponent* previewComp,
732 ComboBox* currentPathBox,
733 TextEditor* filenameBox,
739 auto b =
browserComp.getLocalBounds().reduced (20, 5);
752 if (previewComp !=
nullptr)
753 previewComp->setBounds (b.removeFromRight (b.getWidth() / 3));
755 if (
auto*
listAsComp =
dynamic_cast<Component*
> (fileListComponent))
759void LookAndFeel_V4::drawFileBrowserRow (Graphics& g,
int width,
int height,
760 const File& file,
const String& filename, Image* icon,
764 int itemIndex, DirectoryContentsDisplayComponent&
dcc)
766 LookAndFeel_V2::drawFileBrowserRow (g, width, height, file, filename, icon,
773 const bool isSeparator,
const bool isActive,
774 const bool isHighlighted,
const bool isTicked,
775 const bool hasSubMenu,
const String& text,
794 if (isHighlighted && isActive)
834 auto x =
static_cast<float> (r.removeFromRight ((
int)
arrowH).getX());
835 auto halfH =
static_cast<float> (r.getCentreY());
845 r.removeFromRight (3);
851 f2.setHeight (
f2.getHeight() * 0.75f);
852 f2.setHorizontalScale (0.95f);
880void LookAndFeel_V4::drawMenuBarBackground (
Graphics& g,
int width,
int height,
887 g.
setColour (colour.contrasting (0.15f));
889 g.
fillRect (r.removeFromBottom (1));
895void LookAndFeel_V4::drawMenuBarItem (Graphics& g,
int width,
int height,
896 int itemIndex,
const String&
itemText,
898 bool , MenuBarComponent& menuBar)
900 if (! menuBar.isEnabled())
903 .withMultipliedAlpha (0.5f));
915 g.setFont (getMenuBarFont (menuBar, itemIndex,
itemText));
920void LookAndFeel_V4::drawComboBox (Graphics& g,
int width,
int height,
bool,
921 int,
int,
int,
int, ComboBox& box)
923 auto cornerSize = box.findParentComponentOfClass<ChoicePropertyComponent>() !=
nullptr ? 0.0f : 3.0f;
924 Rectangle<int>
boxBounds (0, 0, width, height);
927 g.fillRoundedRectangle (
boxBounds.toFloat(), cornerSize);
930 g.drawRoundedRectangle (
boxBounds.toFloat().reduced (0.5f, 0.5f), cornerSize, 1.0f);
932 Rectangle<int>
arrowZone (width - 30, 0, 20, height);
934 path.startNewSubPath ((
float)
arrowZone.getX() + 3.0f, (
float)
arrowZone.getCentreY() - 2.0f);
936 path.lineTo ((
float)
arrowZone.getRight() - 3.0f, (
float)
arrowZone.getCentreY() - 2.0f);
939 g.strokePath (path, PathStrokeType (2.0f));
942Font LookAndFeel_V4::getComboBoxFont (ComboBox& box)
944 return {
jmin (16.0f, (
float) box.getHeight() * 0.85f) };
947void LookAndFeel_V4::positionComboBoxText (ComboBox& box, Label& label)
949 label.setBounds (1, 1,
951 box.getHeight() - 2);
953 label.setFont (getComboBoxFont (box));
957int LookAndFeel_V4::getSliderThumbRadius (Slider& slider)
959 return jmin (12, slider.isHorizontal() ?
static_cast<int> ((
float) slider.getHeight() * 0.5f)
963void LookAndFeel_V4::drawLinearSlider (Graphics& g,
int x,
int y,
int width,
int height,
972 g.fillRect (slider.isHorizontal() ? Rectangle<float> (
static_cast<float> (x), (
float) y + 0.5f,
sliderPos - (
float) x, (
float) height - 1.0f)
975 drawLinearSliderOutline (g, x, y, width, height, style, slider);
982 auto trackWidth =
jmin (6.0f, slider.isHorizontal() ? (
float) height * 0.25f : (
float) width * 0.25f);
985 slider.isHorizontal() ? (
float) y + (
float) height * 0.5f : (
float) (height + y));
987 Point<float> endPoint (slider.isHorizontal() ? (
float) (width + x) :
startPoint.x,
1013 auto kx = slider.isHorizontal() ?
sliderPos : ((
float) x + (
float) width * 0.5f);
1014 auto ky = slider.isHorizontal() ? ((
float) y + (
float) height * 0.5f) :
sliderPos;
1020 auto thumbWidth = getSliderThumbRadius (slider);
1038 if (slider.isHorizontal())
1041 jmax (0.0f, (
float) y + (
float) height * 0.5f -
trackWidth * 2.0f),
1045 jmin ((
float) (y + height) -
trackWidth * 2.0f, (
float) y + (
float) height * 0.5f),
1050 drawPointer (g,
jmax (0.0f, (
float) x + (
float) width * 0.5f -
trackWidth * 2.0f),
1060 drawLinearSliderOutline (g, x, y, width, height, style, slider);
1064void LookAndFeel_V4::drawRotarySlider (Graphics& g,
int x,
int y,
int width,
int height,
float sliderPos,
1070 auto bounds = Rectangle<int> (x, y, width, height).toFloat().reduced (10);
1072 auto radius =
jmin (bounds.getWidth(), bounds.getHeight()) / 2.0f;
1074 auto lineW =
jmin (8.0f, radius * 0.5f);
1079 bounds.getCentreY(),
1087 g.setColour (outline);
1090 if (slider.isEnabled())
1093 valueArc.addCentredArc (bounds.getCentreX(),
1094 bounds.getCentreY(),
1114void LookAndFeel_V4::drawPointer (Graphics& g,
const float x,
const float y,
const float diameter,
1115 const Colour& colour,
const int direction)
noexcept
1118 p.startNewSubPath (x +
diameter * 0.5f, y);
1127 g.setColour (colour);
1131Label* LookAndFeel_V4::createSliderTextBox (Slider& slider)
1133 auto*
l = LookAndFeel_V2::createSliderTextBox (slider);
1135 if (getCurrentColourScheme() == LookAndFeel_V4::getGreyColourScheme() && (slider.getSliderStyle() ==
Slider::LinearBar
1145void LookAndFeel_V4::drawTooltip (Graphics& g,
const String& text,
int width,
int height)
1147 Rectangle<int> bounds (width, height);
1148 auto cornerSize = 5.0f;
1151 g.fillRoundedRectangle (bounds.toFloat(), cornerSize);
1154 g.drawRoundedRectangle (bounds.toFloat().reduced (0.5f, 0.5f), cornerSize, 1.0f);
1157 .draw (g, {
static_cast<float> (width),
static_cast<float> (height) });
1161void LookAndFeel_V4::drawConcertinaPanelHeader (Graphics& g,
const Rectangle<int>& area,
1162 bool isMouseOver,
bool ,
1165 auto bounds = area.toFloat().reduced (0.5f);
1166 auto cornerSize = 4.0f;
1170 p.addRoundedRectangle (bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight(),
1174 Colours::darkgrey.withAlpha (0.1f),
static_cast<
float> (area.getBottom())));
1179void LookAndFeel_V4::drawLevelMeter (Graphics& g,
int width,
int height,
float level)
1187 g.fillRoundedRectangle (0.0f, 0.0f,
static_cast<float> (width),
static_cast<float> (height),
outerCornerSize);
1205 g.setColour (c.withAlpha (0.5f));
1207 g.setColour (i <
totalBlocks - 1 ? c : Colours::red);
1218void LookAndFeel_V4::paintToolbarBackground (Graphics& g,
int w,
int h, Toolbar& toolbar)
1222 g.setGradientFill ({ background, 0.0f, 0.0f,
1223 background.darker (0.2f),
1224 toolbar.isVertical() ? (
float) w - 1.0f : 0.0f,
1225 toolbar.isVertical() ? 0.0f : (
float) h - 1.0f,
1230void LookAndFeel_V4::paintToolbarButtonLabel (Graphics& g,
int x,
int y,
int width,
int height,
1231 const String& text, ToolbarItemComponent& component)
1233 auto baseTextColour = component.findParentComponentOfClass<PopupMenu::CustomComponent>() !=
nullptr
1237 g.setColour (
baseTextColour.withAlpha (component.isEnabled() ? 1.0f : 0.25f));
1239 auto fontHeight =
jmin (14.0f, (
float) height * 0.85f);
1240 g.setFont (fontHeight);
1242 g.drawFittedText (text,
1243 x, y, width, height,
1245 jmax (1, height / (
int) fontHeight));
1249void LookAndFeel_V4::drawPropertyPanelSectionHeader (Graphics& g,
const String& name,
1250 bool isOpen,
int width,
int height)
1252 auto buttonSize = (
float) height * 0.75f;
1266void LookAndFeel_V4::drawPropertyComponentBackground (Graphics& g,
int width,
int height, PropertyComponent& component)
1269 g.fillRect (0, 0, width, height - 1);
1272void LookAndFeel_V4::drawPropertyComponentLabel (Graphics& g, [[
maybe_unused]]
int width,
int height, PropertyComponent& component)
1274 auto indent = getPropertyComponentIndent (component);
1277 .withMultipliedAlpha (component.isEnabled() ? 1.0f : 0.6f));
1279 g.setFont ((
float)
jmin (height, 24) * 0.65f);
1281 auto r = getPropertyComponentContentPosition (component);
1283 g.drawFittedText (component.getName(),
1284 indent, r.getY(), r.getX() - 5, r.getHeight(),
1288int LookAndFeel_V4::getPropertyComponentIndent (PropertyComponent& component)
1290 return jmin (10, component.getWidth() / 10);
1293Rectangle<int> LookAndFeel_V4::getPropertyComponentContentPosition (PropertyComponent& component)
1295 auto textW =
jmin (200, component.getWidth() / 2);
1296 return {
textW, 0, component.getWidth() -
textW, component.getHeight() - 1 };
1300void LookAndFeel_V4::drawCallOutBoxBackground (CallOutBox& box, Graphics& g,
1308 DropShadow (Colours::black.withAlpha (0.7f), 8, { 0, 2 }).drawForPath (
g2, path);
1311 g.setColour (Colours::black);
1314 g.setColour (currentColourScheme.
getUIColour (ColourScheme::UIColour::widgetBackground).
withAlpha (0.8f));
1317 g.setColour (currentColourScheme.
getUIColour (ColourScheme::UIColour::outline).
withAlpha (0.8f));
1318 g.strokePath (path, PathStrokeType (2.0f));
1322void LookAndFeel_V4::drawStretchableLayoutResizerBar (Graphics& g,
int ,
int ,
bool ,
1326 g.fillAll (currentColourScheme.
getUIColour (ColourScheme::UIColour::defaultFill).
withAlpha (0.5f));
1330void LookAndFeel_V4::initialiseColours()
1453 0x1000440, currentColourScheme.
getUIColour (ColourScheme::UIColour::defaultFill).
getARGB(),
1454 0x1000441, currentColourScheme.
getUIColour (ColourScheme::UIColour::outline).
getARGB(),
1456 0x1004000, 0xffd3d3d3,
1457 0x1004001, 0xff000000,
1459 0x1005000, 0xffffffff,
1460 0x1005001, 0xff000000,
1461 0x1005002, 0x66000000,
1462 0x1005003, 0x80ffff00,
1463 0x1005004, 0xffb6b600,
1464 0x1005005, 0xff000000,
1465 0x1005006, 0x4c000000,
1467 0x1006000, 0xff1a1c27,
1468 0x1006001, 0x99f1f1f1,
1469 0x1006002, 0xfff1f1f1,
1470 0x1006003, 0x99ba00ff,
1471 0x1006004, 0xfff1f1f1,
1473 0x1004500, currentColourScheme.
getUIColour (ColourScheme::UIColour::widgetBackground).
getARGB(),
1475 0x1004503, currentColourScheme.
getUIColour (ColourScheme::UIColour::defaultText).
getARGB(),
1477 0x1004505, currentColourScheme.
getUIColour (ColourScheme::UIColour::defaultFill).
getARGB(),
1479 0x1007000, currentColourScheme.
getUIColour (ColourScheme::UIColour::widgetBackground).
getARGB(),
1480 0x1007001, currentColourScheme.
getUIColour (ColourScheme::UIColour::defaultText).
getARGB(),
1482 0x100ad00, currentColourScheme.
getUIColour (ColourScheme::UIColour::widgetBackground).
getARGB(),
1483 0x100ad01, currentColourScheme.
getUIColour (ColourScheme::UIColour::defaultText).
getARGB(),
1489 SidePanel::backgroundColour, currentColourScheme.
getUIColour (ColourScheme::UIColour::widgetBackground).
getARGB(),
1490 SidePanel::titleTextColour, currentColourScheme.
getUIColour (ColourScheme::UIColour::defaultText).
getARGB(),
1491 SidePanel::shadowBaseColour, currentColourScheme.
getUIColour (ColourScheme::UIColour::widgetBackground).
darker().
getARGB(),
1492 SidePanel::dismissButtonNormalColour, currentColourScheme.
getUIColour (ColourScheme::UIColour::defaultFill).
getARGB(),
1493 SidePanel::dismissButtonOverColour, currentColourScheme.
getUIColour (ColourScheme::UIColour::defaultFill).
darker().
getARGB(),
1494 SidePanel::dismissButtonDownColour, currentColourScheme.
getUIColour (ColourScheme::UIColour::defaultFill).
brighter().
getARGB(),
A window that displays a message and has buttons for the user to react to it.
@ textColourId
The colour for the text.
@ outlineColourId
An optional colour to use to draw a border around the window.
@ backgroundColourId
The background colour for the window.
@ backgroundColourId
The colour to fill the background of the button area.
@ outlineColourId
The colour to use to draw an outline around the text area.
@ outlineColourId
The colour to use for an outline around the bubble.
@ backgroundColourId
A background colour to fill the bubble with.
@ caretColourId
The colour with which to draw the caret.
static ColourGradient vertical(Colour colour1, float y1, Colour colour2, float y2)
Creates a vertical linear gradient between two Y coordinates.
Represents a colour, also including a transparency value.
Colour withAlpha(uint8 newAlpha) const noexcept
Returns a colour that's the same colour as this one, but with a new alpha value.
Colour brighter(float amountBrighter=0.4f) const noexcept
Returns a brighter version of this colour.
Colour darker(float amountDarker=0.4f) const noexcept
Returns a darker version of this colour.
Colour interpolatedWith(Colour other, float proportionOfOther) const noexcept
Returns a colour that lies somewhere between this one and another.
uint32 getARGB() const noexcept
Returns a 32-bit integer that represents this colour.
Colour contrasting(float amount=1.0f) const noexcept
Returns a colour that will be clearly visible against this colour.
@ arrowColourId
The colour for the arrow shape that pops up the menu.
@ outlineColourId
The colour for an outline around the box.
@ focusedOutlineColourId
The colour that will be used to draw a box around the edge of the component when it has focus.
@ textColourId
The colour for the text in the box.
@ buttonColourId
The base colour for the button (a LookAndFeel class will probably use variations on this).
@ backgroundColourId
The background colour to fill the box with.
The base class for all JUCE user-interface objects.
Component * getParentComponent() const noexcept
Returns the component which this component is inside.
int getHeight() const noexcept
Returns the component's height in pixels.
Colour findColour(int colourID, bool inheritFromParent=false) const
Looks for a colour that has been registered with the given colour ID number.
bool isEnabled() const noexcept
Returns true if the component (and all its parents) are enabled.
Rectangle< int > getLocalBounds() const noexcept
Returns the component's bounds, relative to its own origin.
@ textColourId
The colour for the text.
@ highlightColourId
The colour to use to fill a highlighted row of the list.
@ highlightedTextColourId
The colour with which to draw the text in highlighted sections.
@ textColourId
The colour to draw any text with.
The base class for objects which can draw themselves, e.g.
void drawWithin(Graphics &g, Rectangle< float > destArea, RectanglePlacement placement, float opacity) const
Renders the Drawable within a rectangle, scaling it to fit neatly inside without changing its aspect-...
@ currentPathBoxTextColourId
The colour to use for the text of the current path ComboBox.
@ filenameBoxBackgroundColourId
The colour to use to fill the background of the filename TextEditor.
@ currentPathBoxBackgroundColourId
The colour to use to fill the background of the current path ComboBox.
@ filenameBoxTextColourId
The colour to use for the text of the filename TextEditor.
@ currentPathBoxArrowColourId
The colour to use to draw the arrow of the current path ComboBox.
@ titleTextColourId
The colour to use to draw the box's title.
@ backgroundColourId
The background colour to fill the component with.
Represents a particular font, including its size, style, etc.
float getAscent() const
Returns the height of the font above its baseline, in pixels.
@ plain
indicates a plain, non-bold, non-italic version of the font.
@ italic
finds an italic version of the font.
A graphics context, used for drawing a component or image.
void setOpacity(float newOpacity)
Changes the opacity to use with the current colour.
void drawText(const String &text, int x, int y, int width, int height, Justification justificationType, bool useEllipsesIfTooBig=true) const
Draws a line of text within a specified rectangle.
void drawFittedText(const String &text, int x, int y, int width, int height, Justification justificationFlags, int maximumNumberOfLines, float minimumHorizontalScale=0.0f) const
Tries to draw a text string inside a given space.
void setFont(const Font &newFont)
Changes the font to use for subsequent text-drawing functions.
void setGradientFill(const ColourGradient &gradient)
Sets the context to use a gradient for its fill pattern.
void fillRoundedRectangle(float x, float y, float width, float height, float cornerSize) const
Uses the current colour or brush to fill a rectangle with rounded corners.
void setTiledImageFill(const Image &imageToUse, int anchorX, int anchorY, float opacity)
Sets the context to use a tiled image pattern for filling.
void fillRect(Rectangle< int > rectangle) const
Fills a rectangle with the current colour or brush.
void fillPath(const Path &path) const
Fills a path using the currently selected colour or brush.
bool reduceClipRegion(int x, int y, int width, int height)
Intersects the current clipping region with another region.
void drawHorizontalLine(int y, float left, float right) const
Draws a horizontal line of pixels at a given y position.
void setColour(Colour newColour)
Changes the current drawing colour.
void strokePath(const Path &path, const PathStrokeType &strokeType, const AffineTransform &transform={}) const
Draws a path's outline using the currently selected colour or brush.
void fillAll() const
Fills the context's entire clip region with the current colour or brush.
void drawRoundedRectangle(float x, float y, float width, float height, float cornerSize, float lineThickness) const
Uses the current colour or brush to draw the outline of a rectangle with rounded corners.
@ textColourId
The colour to use to draw the text label.
@ outlineColourId
The colour to use for drawing the line around the edge.
@ ARGB
< each pixel is a 4-byte ARGB premultiplied colour value.
Represents a type of justification to be used when positioning graphical items.
@ centredRight
Indicates that the item should be centred vertically but placed on the right hand side.
@ centred
Indicates that the item should be centred vertically and horizontally.
@ centredLeft
Indicates that the item should be centred vertically but placed on the left hand side.
const Rectangle< ValueType > appliedToRectangle(const Rectangle< ValueType > &areaToAdjust, const Rectangle< ValueType > &targetSpace) const noexcept
Returns the new position of a rectangle that has been justified to fit within a given space.
@ outlineColourId
An optional colour to use to draw a border around the label.
@ backgroundColourId
The background colour to fill the label with.
@ textWhenEditingColourId
The colour for the text when the label is being edited.
@ textColourId
The colour for the text.
@ textColourId
The preferred colour to use for drawing text in the listbox.
@ backgroundColourId
The background colour to fill the list with.
@ outlineColourId
An optional colour to use to draw a border around the list.
Font getPopupMenuFont() override
Returns the size and style of font to use in popup menus.
A struct containing the set of colours to apply to the GUI.
Colour getUIColour(UIColour colourToGet) const noexcept
Returns a colour from the scheme.
bool operator==(const ColourScheme &) const noexcept
Returns true if two ColourPalette objects contain the same colours.
UIColour
The standard set of colours to use.
bool operator!=(const ColourScheme &) const noexcept
Returns false if two ColourPalette objects contain the same colours.
void setUIColour(UIColour colourToSet, Colour newColour) noexcept
Sets a scheme colour.
The latest JUCE look-and-feel style, as introduced in 2017.
void drawToggleButton(Graphics &, ToggleButton &, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Draws the contents of a standard ToggleButton.
void drawScrollbar(Graphics &, ScrollBar &, int x, int y, int width, int height, bool isScrollbarVertical, int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown) override
Draws the thumb area of a scrollbar.
void drawProgressBar(Graphics &, ProgressBar &, int width, int height, double progress, const String &) override
Draws a progress bar.
void getIdealPopupMenuItemSize(const String &text, bool isSeparator, int standardMenuItemHeight, int &idealWidth, int &idealHeight) override
Finds the best size for an item in a popup menu.
Font getAlertWindowTitleFont() override
Override this function to supply a custom font for the alert window title.
Path getTickShape(float height) override
Returns a tick shape for use in yes/no boxes, etc.
ProgressBar::Style getDefaultProgressBarStyle(const ProgressBar &) override
Returns the default style a progress bar should use if one hasn't been set.
Font getAlertWindowMessageFont() override
Override this function to supply a custom font for the alert window message.
~LookAndFeel_V4() override
Destructor.
LookAndFeel_V4()
Creates a LookAndFeel_V4 object with a default colour scheme.
int getDefaultScrollbarWidth() override
Returns the default thickness to use for a scrollbar.
Path getCrossShape(float height) override
Returns a cross shape for use in yes/no boxes, etc.
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
Draws one of the items in a popup menu.
bool isColourSpecified(int colourId) const noexcept
Returns true if the specified colour ID has been explicitly set using the setColour() method.
void setColour(int colourId, Colour colour) noexcept
Registers a colour to be used for a particular purpose.
Colour findColour(int colourId) const noexcept
Looks for a colour that has been registered with the given colour ID number.
Describes a type of stroke used to render a solid outline along a path.
@ curved
Indicates that corners should be drawn as rounded-off.
@ rounded
Ends of lines are rounded-off with a circular shape.
A path is a sequence of lines and curves that may either form a closed shape or be open-ended.
void loadPathFromData(const void *data, size_t numberOfBytes)
Loads a stored path from a block of data.
void addRoundedRectangle(float x, float y, float width, float height, float cornerSize)
Adds a rectangle with rounded corners to the path.
void startNewSubPath(float startX, float startY)
Begins a new subpath with a given starting position.
void scaleToFit(float x, float y, float width, float height, bool preserveProportions) noexcept
Rescales this path to make it fit neatly into a given space.
void lineTo(float endX, float endY)
Adds a line from the shape's last position to a new end-point.
void addLineSegment(Line< float > line, float lineThickness)
Adds a line with a specified thickness.
void addQuadrilateral(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
Adds a quadrilateral to the path.
A progress bar component.
@ backgroundColourId
The background colour, behind the bar.
@ foregroundColourId
The colour to use to draw the bar itself.
Style
The types of ProgressBar styles available.
@ linear
A linear progress bar.
@ circular
A circular progress indicator.
@ labelTextColourId
The colour for the property's label text.
@ backgroundColourId
The background colour to fill the component with.
@ onlyReduceInSize
Indicates that the source rectangle can be reduced in size if required, but should never be made larg...
@ centred
A shorthand value that is equivalent to (xMid | yMid).
Manages a rectangle and allows geometric operations to be performed on it.
ValueType getWidth() const noexcept
Returns the width of the rectangle.
Rectangle removeFromTop(ValueType amountToRemove) noexcept
Removes a strip from the top of this rectangle, reducing this rectangle by the specified amount and r...
Rectangle reduced(ValueType deltaX, ValueType deltaY) const noexcept
Returns a rectangle that is smaller than this one by a given amount.
@ backgroundColourId
A colour to use to fill the window's background.
SliderStyle
The types of slider available.
@ LinearBarVertical
A vertical bar slider with the text label drawn on top of it.
@ ThreeValueHorizontal
A horizontal slider that has three thumbs instead of one, so it can show a minimum and maximum value,...
@ TwoValueHorizontal
A horizontal slider that has two thumbs instead of one, so it can show a minimum and maximum value.
@ LinearBar
A horizontal bar slider with the text label drawn on top of it.
@ ThreeValueVertical
A vertical slider that has three thumbs instead of one, so it can show a minimum and maximum value,...
@ TwoValueVertical
A vertical slider that has two thumbs instead of one, so it can show a minimum and maximum value.
@ textBoxBackgroundColourId
The background colour for the text-editor box.
@ textBoxTextColourId
The colour for the text in the text-editor box used for editing the value.
@ rotarySliderFillColourId
For rotary sliders, this colour fills the outer curve.
@ textBoxHighlightColourId
The text highlight colour for the text-editor box.
@ textBoxOutlineColourId
The colour to use for a border around the text-editor box.
@ trackColourId
The colour to draw the groove that the thumb moves along.
@ backgroundColourId
A colour to use to fill the slider's background.
@ rotarySliderOutlineColourId
For rotary sliders, this colour is used to draw the outer curve's outline.
@ thumbColourId
The colour to draw the thumb with.
static String charToString(juce_wchar character)
Creates a string from a single character.
@ outlineColourId
The colour to use to draw an outline around the content.
@ backgroundColourId
The colour to fill the background behind the tabs.
@ textColourOnId
The colour to use for the button's text.when the button's toggle state is "on".
@ buttonColourId
The colour used to fill the button shape (when the button is toggled 'off').
@ buttonOnColourId
The colour used to fill the button shape (when the button is toggled 'on').
@ textColourOffId
The colour to use for the button's text when the button's toggle state is "off".
@ backgroundColourId
The colour to use for the text component's background - this can be transparent if necessary.
@ highlightColourId
The colour with which to fill the background of highlighted sections of the text - this can be transp...
@ textColourId
The colour that will be used when text is added to the editor.
@ outlineColourId
If this is non-transparent, it will be used to draw a box around the edge of the component.
@ highlightedTextColourId
The colour with which to draw the text in highlighted sections.
@ focusedOutlineColourId
If this is non-transparent, it will be used to draw a box around the edge of the component when it ha...
@ shadowColourId
If this is non-transparent, it'll be used to draw an inner shadow around the edge of the editor.
@ backgroundColourId
The colour to fill the background of the text area.
@ outlineColourId
The colour to use to draw an outline around the text area.
@ textColourId
The colour to use for the editable text.
static uint32 getMillisecondCounter() noexcept
Returns the number of millisecs since a fixed event (usually system startup).
@ dragAndDropIndicatorColourId
The colour to use for the drag-and-drop target position indicator.
@ oddItemsColourId
The colour to use to fill the background of the odd numbered items.
@ linesColourId
The colour to draw the lines with.
@ evenItemsColourId
The colour to use to fill the background of the even numbered items.
@ selectedItemBackgroundColourId
The colour to use to fill the background of any selected items.
@ backgroundColourId
A background colour to fill the component with.
wchar_t juce_wchar
A platform-independent 32-bit unicode character type.
constexpr Type jmin(Type a, Type b)
Returns the smaller of two values.
constexpr Type jmax(Type a, Type b)
Returns the larger of two values.
MessageBoxIconType
The type of icon to show in the dialog box.
@ WarningIcon
An exclamation mark to indicate that the dialog is a warning about something and shouldn't be ignored...
@ NoIcon
No icon will be shown on the dialog box.
@ InfoIcon
An icon that indicates that the dialog box is just giving the user some information,...
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
bool isPositiveAndBelow(Type1 valueToTest, Type2 upperLimit) noexcept
Returns true if a value is at least zero, and also below a specified upper limit.
unsigned int uint32
A platform-independent 32-bit unsigned integer type.
constexpr FloatType degreesToRadians(FloatType degrees) noexcept
Converts an angle in degrees to radians.
unsigned char uint8
A platform-independent 8-bit unsigned integer type.
int roundToInt(const FloatType value) noexcept
Fast floating-point-to-integer conversion.
constexpr int numElementsInArray(Type(&)[N]) noexcept
Handy function for getting the number of elements in a simple const C array.
static constexpr FloatType halfPi
A predefined value for Pi / 2.
static constexpr FloatType twoPi
A predefined value for 2 * Pi.
static constexpr FloatType pi
A predefined value for Pi.