54 bool shouldDrawButtonAsHighlighted,
bool shouldDrawButtonAsDown)
59 const float indent = 2.0f;
64 p.addRoundedRectangle (indent, indent,
65 (
float)
width - indent * 2.0f,
66 (
float)
height - indent * 2.0f,
71 if (shouldDrawButtonAsHighlighted)
73 if (shouldDrawButtonAsDown)
85 g.strokePath (
p,
PathStrokeType ((shouldDrawButtonAsHighlighted) ? 2.0f : 1.4f));
89 float x,
float y,
float w,
float h,
93 const bool shouldDrawButtonAsDown)
96 box.addRoundedRectangle (0.0f, 2.0f, 6.0f, 6.0f, 1.0f);
98 g.setColour (isEnabled ?
Colours::blue.withAlpha (shouldDrawButtonAsDown ? 0.3f : 0.1f)
103 g.fillPath (
box, trans);
122 if (
button.hasKeyboardFocus (
true))
128 const int tickWidth =
jmin (20,
button.getHeight() - 4);
131 (
float) tickWidth, (
float) tickWidth,
134 shouldDrawButtonAsHighlighted,
135 shouldDrawButtonAsDown);
138 g.setFont (
jmin (15.0f, (
float)
button.getHeight() * 0.6f));
143 const int textX = tickWidth + 5;
145 g.drawFittedText (
button.getButtonText(),
153 double progress,
const String& textToShow)
155 if (progress < 0 || progress >= 1.0)
164 g.fillAll (background);
165 g.setColour (foreground);
174 g.setFont ((
float)
height * 0.6f);
183 bool isScrollbarVertical,
184 bool shouldDrawButtonAsHighlighted,
185 bool shouldDrawButtonAsDown)
187 if (isScrollbarVertical)
194 const auto w = (float)
width;
197 if (buttonDirection == 0)
198 p.addTriangle (
w * 0.5f,
h * 0.2f,
201 else if (buttonDirection == 1)
202 p.addTriangle (
w * 0.8f,
h * 0.5f,
205 else if (buttonDirection == 2)
206 p.addTriangle (
w * 0.5f,
h * 0.8f,
209 else if (buttonDirection == 3)
210 p.addTriangle (
w * 0.2f,
h * 0.5f,
214 if (shouldDrawButtonAsDown)
216 else if (shouldDrawButtonAsHighlighted)
229 bool isScrollbarVertical,
int thumbStartPosition,
int thumbSize,
230 bool isMouseOver,
bool isMouseDown)
235 .
withAlpha ((isMouseOver || isMouseDown) ? 0.4f : 0.15f));
237 if ((
float) thumbSize > 0.0f)
241 if (isScrollbarVertical)
248 width - 2, thumbSize);
261 .
withAlpha ((isMouseOver || isMouseDown) ? 0.95f : 0.7f));
265 g.setColour (
Colours::black.withAlpha ((isMouseOver || isMouseDown) ? 0.4f : 0.25f));
270 for (
int i = 3; --
i >= 0;)
272 const float linePos = (float) thumbStartPosition + (
float) thumbSize * 0.5f + (float) (
i - 1) * 4.0f;
275 if (isScrollbarVertical)
277 g.drawLine ((
float)
x + (
float)
width * 0.2f, linePos, (
float)
width * 0.8f, linePos);
279 g.drawLine ((
float)
width * 0.2f, linePos - 1.0f, (
float)
width * 0.8f, linePos - 1.0f);
283 g.drawLine (linePos, (
float)
height * 0.2f, linePos, (
float)
height * 0.8f);
285 g.drawLine (linePos - 1.0f, (
float)
height * 0.2f, linePos - 1.0f, (
float)
height * 0.8f);
325 const bool isButtonDown,
326 int buttonX,
int buttonY,
int buttonW,
int buttonH,
333 g.fillRect (buttonX, buttonY, buttonW, buttonH);
338 const float arrowX = 0.2f;
339 const float arrowH = 0.3f;
341 const auto x = (float) buttonX;
342 const auto y = (float) buttonY;
343 const auto w = (float) buttonW;
344 const auto h = (float) buttonH;
349 p.addTriangle (
x +
w * 0.5f,
y +
h * (0.45f - arrowH),
350 x +
w * (1.0f - arrowX),
y +
h * 0.45f,
351 x +
w * arrowX,
y +
h * 0.45f);
353 p.addTriangle (
x +
w * 0.5f,
y +
h * (0.55f + arrowH),
354 x +
w * (1.0f - arrowX),
y +
h * 0.55f,
355 x +
w * arrowX,
y +
h * 0.55f);
366 f.setHorizontalScale (0.9f);
374 p.addTriangle (x1, y1, x2, y2, x3, y3);
378 g.setColour (outline);
383 int x,
int y,
int w,
int h,
384 float sliderPos,
float minSliderPos,
float maxSliderPos,
393 g.fillRect (
x,
y, (
int) sliderPos -
x,
h);
396 g.drawRect (
x,
y, (
int) sliderPos -
x,
h);
401 .withMultipliedAlpha (
slider.isEnabled() ? 1.0f : 0.3f));
403 if (
slider.isHorizontal())
417 alpha =
slider.isMouseOverOrDragging() ? 1.0f : 0.7f;
425 (
float)
x + (
float)
w * 0.5f +
jmin (4.0f, (
float)
w * 0.3f), minSliderPos,
426 (
float)
x + (
float)
w * 0.5f -
jmin (8.0f, (
float)
w * 0.4f), minSliderPos - 7.0f,
427 (
float)
x + (
float)
w * 0.5f -
jmin (8.0f, (
float)
w * 0.4f), minSliderPos,
431 (
float)
x + (
float)
w * 0.5f +
jmin (4.0f, (
float)
w * 0.3f), maxSliderPos,
432 (
float)
x + (
float)
w * 0.5f -
jmin (8.0f, (
float)
w * 0.4f), maxSliderPos,
433 (
float)
x + (
float)
w * 0.5f -
jmin (8.0f, (
float)
w * 0.4f), maxSliderPos + 7.0f,
439 minSliderPos, (
float)
y + (
float)
h * 0.6f -
jmin (4.0f, (
float)
h * 0.3f),
440 minSliderPos - 7.0f, (
float)
y + (
float)
h * 0.9f,
441 minSliderPos, (
float)
y + (
float)
h * 0.9f,
445 maxSliderPos, (
float)
y + (
float)
h * 0.6f -
jmin (4.0f, (
float)
h * 0.3f),
446 maxSliderPos, (
float)
y + (
float)
h * 0.9f,
447 maxSliderPos + 7.0f, (
float)
y + (
float)
h * 0.9f,
454 sliderPos, (
float)
y + (
float)
h * 0.9f,
455 sliderPos - 7.0f, (
float)
y + (
float)
h * 0.2f,
456 sliderPos + 7.0f, (
float)
y + (
float)
h * 0.2f,
462 (
float)
x + (
float)
w * 0.5f -
jmin (4.0f, (
float)
w * 0.3f), sliderPos,
463 (
float)
x + (
float)
w * 0.5f +
jmin (8.0f, (
float)
w * 0.4f), sliderPos - 7.0f,
464 (
float)
x + (
float)
w * 0.5f +
jmin (8.0f, (
float)
w * 0.4f), sliderPos + 7.0f,
494 const float lineThickness = (float)
jmin (
w,
h) * 0.1f;
496 for (
float i = 0.0f;
i < 1.0f;
i += 0.3f)
498 g.drawLine ((
float)
w *
i,
521 b->setShape (shape,
true,
true,
true);
553 int titleBarX,
int titleBarY,
int titleBarW,
int titleBarH,
557 bool positionTitleBarButtonsOnLeft)
559 titleBarY += titleBarH / 8;
560 titleBarH -= titleBarH / 4;
562 const int buttonW = titleBarH;
564 int x = positionTitleBarButtonsOnLeft ? titleBarX + 4
565 : titleBarX + titleBarW - buttonW - 4;
567 if (closeButton !=
nullptr)
569 closeButton->
setBounds (
x, titleBarY, buttonW, titleBarH);
570 x += positionTitleBarButtonsOnLeft ? buttonW + buttonW / 5
571 : -(buttonW + buttonW / 5);
574 if (positionTitleBarButtonsOnLeft)
575 std::swap (minimiseButton, maximiseButton);
577 if (maximiseButton !=
nullptr)
579 maximiseButton->
setBounds (
x, titleBarY - 2, buttonW, titleBarH);
580 x += positionTitleBarButtonsOnLeft ? buttonW : -buttonW;
583 if (minimiseButton !=
nullptr)
584 minimiseButton->
setBounds (
x, titleBarY - 2, buttonW, titleBarH);
Type jmin(const Type a, const Type b)
Definition MathsFunctions.h:60
static void drawTriangle(const Point< T > &pos1, const Point< T > &pos2, const Point< T > &pos3, const bool outline)
Definition OpenGL.cpp:214
int dp
Definition Spc_Cpu.h:149
Definition juce_Colour.h:38
Colour withAlpha(uint8 newAlpha) const noexcept
Definition juce_Colour.cpp:317
JUCE_NODISCARD Colour brighter(float amountBrighter=0.4f) const noexcept
Definition juce_Colour.cpp:461
JUCE_NODISCARD Colour withMultipliedSaturation(float multiplier) const noexcept
Definition juce_Colour.cpp:432
JUCE_NODISCARD Colour darker(float amountDarker=0.4f) const noexcept
Definition juce_Colour.cpp:472
float getBrightness() const noexcept
Definition juce_Colour.cpp:405
JUCE_NODISCARD Colour contrasting(float amount=1.0f) const noexcept
Definition juce_Colour.cpp:491
Definition juce_ComboBox.h:49
@ outlineColourId
Definition juce_ComboBox.h:358
@ buttonColourId
Definition juce_ComboBox.h:359
@ backgroundColourId
Definition juce_ComboBox.h:356
Definition juce_Component.h:36
void setBounds(int x, int y, int width, int height)
Definition juce_Component.cpp:1147
Colour findColour(int colourID, bool inheritFromParent=false) const
Definition juce_Component.cpp:2219
bool isEnabled() const noexcept
Definition juce_Component.cpp:3104
Definition juce_DocumentWindow.h:55
@ closeButton
Definition juce_DocumentWindow.h:66
@ maximiseButton
Definition juce_DocumentWindow.h:65
@ minimiseButton
Definition juce_DocumentWindow.h:64
Definition juce_DrawablePath.h:40
Definition juce_Font.h:42
Definition juce_GraphicsContext.h:45
Definition juce_ImageEffectFilter.h:43
@ centred
Definition juce_Justification.h:138
@ centredLeft
Definition juce_Justification.h:143
Definition juce_Line.h:47
@ outlineColourId
Definition juce_ListBox.h:496
void drawPopupMenuBackground(Graphics &, int width, int height) override
Definition juce_LookAndFeel_V1.cpp:299
void drawMenuBarBackground(Graphics &, int width, int height, bool isMouseOverBar, MenuBarComponent &) override
Definition juce_LookAndFeel_V1.cpp:307
void drawTickBox(Graphics &, Component &, float x, float y, float w, float h, bool ticked, bool isEnabled, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Definition juce_LookAndFeel_V1.cpp:88
void drawCornerResizer(Graphics &, int w, int h, bool isMouseOver, bool isMouseDragging) override
Definition juce_LookAndFeel_V1.cpp:489
void drawToggleButton(Graphics &, ToggleButton &, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Definition juce_LookAndFeel_V1.cpp:120
LookAndFeel_V1()
Definition juce_LookAndFeel_V1.cpp:29
void drawScrollbarButton(Graphics &, ScrollBar &, int width, int height, int buttonDirection, bool isScrollbarVertical, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Definition juce_LookAndFeel_V1.cpp:181
void drawButtonBackground(Graphics &, Button &, const Colour &backgroundColour, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Definition juce_LookAndFeel_V1.cpp:53
void positionDocumentWindowButtons(DocumentWindow &, int titleBarX, int titleBarY, int titleBarW, int titleBarH, Button *minimiseButton, Button *maximiseButton, Button *closeButton, bool positionTitleBarButtonsOnLeft) override
Definition juce_LookAndFeel_V1.cpp:552
~LookAndFeel_V1() override
Definition juce_LookAndFeel_V1.cpp:48
DropShadowEffect scrollbarShadow
Definition juce_LookAndFeel_V1.h:100
Button * createDocumentWindowButton(int buttonType) override
Definition juce_LookAndFeel_V1.cpp:507
void drawComboBox(Graphics &, int width, int height, bool isButtonDown, int buttonX, int buttonY, int buttonW, int buttonH, ComboBox &) override
Definition juce_LookAndFeel_V1.cpp:324
int getSliderThumbRadius(Slider &) override
Definition juce_LookAndFeel_V1.cpp:483
Button * createSliderButton(Slider &, bool isIncrement) override
Definition juce_LookAndFeel_V1.cpp:470
ImageEffectFilter * getSliderEffect(Slider &) override
Definition juce_LookAndFeel_V1.cpp:478
Font getComboBoxFont(ComboBox &) override
Definition juce_LookAndFeel_V1.cpp:363
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_V1.cpp:382
void drawTextEditorOutline(Graphics &, int width, int height, TextEditor &) override
Definition juce_LookAndFeel_V1.cpp:314
void drawProgressBar(Graphics &, ProgressBar &, int width, int height, double progress, const String &textToShow) override
Definition juce_LookAndFeel_V1.cpp:151
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_V1.cpp:227
ImageEffectFilter * getScrollbarEffect() override
Definition juce_LookAndFeel_V1.cpp:292
void drawProgressBar(Graphics &, ProgressBar &, int width, int height, double progress, const String &textToShow) override
Definition juce_LookAndFeel_V2.cpp:559
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_Path.h:65
void startNewSubPath(float startX, float startY)
Definition juce_Path.cpp:216
void lineTo(float endX, float endY)
Definition juce_Path.cpp:233
void addLineSegment(Line< float > line, float lineThickness)
Definition juce_Path.cpp:581
Definition juce_PathStrokeType.h:42
Definition juce_Point.h:42
Definition juce_ProgressBar.h:51
@ backgroundColourId
Definition juce_ProgressBar.h:95
@ foregroundColourId
Definition juce_ProgressBar.h:96
Definition juce_Rectangle.h:67
ValueType getHeight() const noexcept
Definition juce_Rectangle.h:136
ValueType getX() const noexcept
Definition juce_Rectangle.h:127
ValueType getWidth() const noexcept
Definition juce_Rectangle.h:133
ValueType getY() const noexcept
Definition juce_Rectangle.h:130
void setBounds(ValueType newX, ValueType newY, ValueType newWidth, ValueType newHeight) noexcept
Definition juce_Rectangle.h:191
Definition juce_Slider.h:54
SliderStyle
Definition juce_Slider.h:62
@ 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
@ textBoxTextColourId
Definition juce_Slider.h:873
@ textBoxOutlineColourId
Definition juce_Slider.h:876
@ trackColourId
Definition juce_Slider.h:869
@ backgroundColourId
Definition juce_Slider.h:866
@ thumbColourId
Definition juce_Slider.h:867
Definition juce_String.h:53
bool isNotEmpty() const noexcept
Definition juce_String.h:316
@ buttonColourId
Definition juce_TextButton.h:73
Definition juce_TextEditor.h:43
@ outlineColourId
Definition juce_TextEditor.h:223
@ focusedOutlineColourId
Definition juce_TextEditor.h:226
UINT_D64 w
Definition inflate.c:942
int y
Definition inflate.c:1588
int g
Definition inflate.c:1573
register unsigned i
Definition inflate.c:1575
unsigned x[BMAX+1]
Definition inflate.c:1586
unsigned f
Definition inflate.c:1572
static int int height
Definition pugl.h:1594
static int width
Definition pugl.h:1593
const Colour transparentBlack
Definition juce_Colours.h:40
const Colour lightgrey
Definition juce_Colours.h:111
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 green
Definition juce_Colours.h:94
const Colour white
Definition juce_Colours.h:180
const Colour blue
Definition juce_Colours.h:52
Definition carla_juce.cpp:31
constexpr Type jmin(Type a, Type b)
Definition juce_MathsFunctions.h:106
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Definition juce_MathsFunctions.h:262
int roundToInt(const FloatType value) noexcept
Definition juce_MathsFunctions.h:465
@ slider
Definition juce_AccessibilityRole.h:43
@ menuBar
Definition juce_AccessibilityRole.h:48
@ progressBar
Definition juce_AccessibilityRole.h:60
@ button
Definition juce_AccessibilityRole.h:38
Definition juce_DropShadowEffect.h:36
uch * p
Definition crypt.c:594
uch h[RAND_HEAD_LEN]
Definition crypt.c:459