9 setColour(PopupMenu::backgroundColourId, Colour(0xff111111));
10 setColour(PopupMenu::textColourId, Colour(0xffcccccc));
11 setColour(PopupMenu::headerTextColourId, Colour(0xffffffff));
12 setColour(PopupMenu::highlightedBackgroundColourId, Colour(0xff8458b7));
13 setColour(PopupMenu::highlightedTextColourId, Colour(0xffffffff));
14 setColour(BubbleComponent::backgroundColourId, Colour(0xff111111));
15 setColour(BubbleComponent::outlineColourId, Colour(0xff333333));
16 setColour(TooltipWindow::textColourId, Colour(0xffdddddd));
20 if (width <= 0 || height <= 0)
23 float rounding = 5.0f;
29 g.fillRoundedRectangle(0, 0, width, height, rounding);
31 g.drawRoundedRectangle(0.5f, 0.5f, width - 1.0f, height - 1.0f, rounding, 1.0f);
35 g.setColour(findColour(PopupMenu::backgroundColourId));
37 g.setColour(findColour(BubbleComponent::outlineColourId));
38 g.drawRoundedRectangle(0.5f, 0.5f, width - 1.0f, height - 1.0f,
kPopupMenuBorder, 1.0f);
42 bool vertical,
int thumb_position,
int thumb_size,
43 bool mouse_over,
bool mouse_down) {
44 if (thumb_size >= height)
49 int draw_width = width / 2 - 2;
50 if (mouse_down || mouse_over)
51 draw_width = width - 2;
59 draw_x = width - 1 - draw_width;
62 for (
int i = 0 ; i < draw_times; ++i)
63 g.fillRoundedRectangle(draw_x, thumb_position, draw_width, thumb_size, draw_width / 2.0f);
67 int button_x,
int button_y,
int button_w,
int button_h, ComboBox& box) {
68 static constexpr float kRoundness = 4.0f;
69 g.setColour(findColour(BubbleComponent::backgroundColourId));
70 g.fillRoundedRectangle(box.getLocalBounds().toFloat(), kRoundness);
74 Rectangle<int> arrow_bounds = box.getLocalBounds().removeFromRight(height);
75 g.fillPath(path, path.getTransformToScaleToFit(arrow_bounds.toFloat(),
true));
79 float x,
float y,
float w,
float h,
bool ticked,
80 bool enabled,
bool mouse_over,
bool button_down) {
81 static constexpr float kBorderPercent = 0.15f;
87 float border_width = h * kBorderPercent;
88 g.fillRect(x + border_width, y + border_width, w - 2 * border_width, h - 2 * border_width);
92 g.setColour(call_out_box.findColour(
Skin::kBody,
true));
96 g.strokePath(path, PathStrokeType(1.0f));
100 bool hover,
bool down) {
102 g.fillRoundedRectangle(button.getLocalBounds().toFloat(), 5.0f);
110 return LookAndFeel_V3::getSliderPopupPlacement(slider);
DefaultLookAndFeel()
Protected constructor to enforce singleton usage.
Definition default_look_and_feel.cpp:8
static constexpr int kPopupMenuBorder
Border size for popup menus.
Definition default_look_and_feel.h:33
virtual void drawScrollbar(Graphics &g, ScrollBar &scroll_bar, int x, int y, int width, int height, bool vertical, int thumb_position, int thumb_size, bool mouse_over, bool mouse_down) override
Draws a custom scrollbar, potentially aligned differently if it's a LeftAlignedScrollBar.
Definition default_look_and_feel.cpp:41
void drawCallOutBoxBackground(CallOutBox &call_out_box, Graphics &g, const Path &path, Image &) override
Draws the background of a CallOutBox with a simple rounded rectangle and stroke.
Definition default_look_and_feel.cpp:91
int getSliderPopupPlacement(Slider &slider) override
Gets the popup placement for a slider. Delegates to SynthSlider if present.
Definition default_look_and_feel.cpp:105
void drawPopupMenuBackground(Graphics &g, int width, int height) override
Draws the background for a popup menu with a rounded rectangle and border.
Definition default_look_and_feel.cpp:34
Font getSliderPopupFont(Slider &slider) override
Returns the font to use for slider popup text.
Definition default_look_and_feel.cpp:117
void drawTickBox(Graphics &g, Component &component, float x, float y, float w, float h, bool ticked, bool enabled, bool mouse_over, bool button_down) override
Draws a tick box (check box) with a filled rectangle if ticked.
Definition default_look_and_feel.cpp:78
void drawComboBox(Graphics &g, int width, int height, const bool button_down, int button_x, int button_y, int button_w, int button_h, ComboBox &box) override
Draws the background and arrow of a ComboBox.
Definition default_look_and_feel.cpp:66
void drawButtonBackground(Graphics &g, Button &button, const Colour &background_color, bool hover, bool down) override
Draws the background of a generic button, using a rounded rectangle.
Definition default_look_and_feel.cpp:99
void fillTextEditorBackground(Graphics &g, int width, int height, TextEditor &text_editor) override
Fills the background of a TextEditor with a rounded rectangle and border.
Definition default_look_and_feel.cpp:19
Font getPopupMenuFont() override
Returns the font to use for popup menus.
Definition default_look_and_feel.cpp:113
Font & proportional_regular()
Returns a reference to the proportional regular font.
Definition fonts.h:22
static Fonts * instance()
Gets the singleton instance of the Fonts class.
Definition fonts.h:52
static Path downTriangle()
Definition paths.h:390
@ kWidgetRoundedCorner
Definition skin.h:104
@ kIconButtonOn
Definition skin.h:188
@ kPopupBorder
Definition skin.h:145
@ kTextEditorBackground
Definition skin.h:200
@ kTextEditorBorder
Definition skin.h:201
@ kLightenScreen
Definition skin.h:141
@ kPopupSelectorBackground
Definition skin.h:143
@ kTextComponentText
Definition skin.h:148
@ kBody
Definition skin.h:129
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
float findValue(Skin::ValueId value_id) const
Finds a value in the skin overrides or from the parent if not found locally.
Definition synth_section.cpp:18
A specialized slider with extended functionality for modulation, parameter control,...
Definition synth_slider.h:314
BubbleComponent::BubblePlacement getPopupPlacement()
Definition synth_slider.h:527
Declares the SynthSlider and related classes, providing various slider styles and functionality in th...