Vital
|
A base LookAndFeel class providing default styling for UI elements. More...
#include <default_look_and_feel.h>
Public Member Functions | |
~DefaultLookAndFeel () | |
Destructor. | |
virtual int | getPopupMenuBorderSize () override |
Returns the border size for popup menus. | |
void | drawTextEditorOutline (Graphics &g, int width, int height, TextEditor &text_editor) override |
Draws no outline for TextEditors by default. | |
void | fillTextEditorBackground (Graphics &g, int width, int height, TextEditor &text_editor) override |
Fills the background of a TextEditor with a rounded rectangle and border. | |
void | drawPopupMenuBackground (Graphics &g, int width, int height) override |
Draws the background for a popup menu with a rounded rectangle and border. | |
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. | |
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. | |
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. | |
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. | |
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. | |
int | getSliderPopupPlacement (Slider &slider) override |
Gets the popup placement for a slider. Delegates to SynthSlider if present. | |
Font | getPopupMenuFont () override |
Returns the font to use for popup menus. | |
Font | getSliderPopupFont (Slider &slider) override |
Returns the font to use for slider popup text. | |
int | getMenuWindowFlags () override |
Returns the window flags for menu windows. Defaults to 0. | |
Static Public Member Functions | |
static DefaultLookAndFeel * | instance () |
Singleton instance accessor. | |
Static Public Attributes | |
static constexpr int | kPopupMenuBorder = 4 |
Border size for popup menus. | |
Protected Member Functions | |
DefaultLookAndFeel () | |
Protected constructor to enforce singleton usage. | |
A base LookAndFeel class providing default styling for UI elements.
This LookAndFeel sets up background colors, borders, popup menus, scrollbars, combo boxes, and tick boxes with a consistent appearance. It also provides default fonts for popup menus and slider popups.
|
inline |
Destructor.
|
protected |
Protected constructor to enforce singleton usage.
|
override |
Draws the background of a generic button, using a rounded rectangle.
g | The Graphics context. |
button | The button to draw. |
background_color | The base background color. |
hover | True if mouse is hovering the button. |
down | True if mouse is pressed down on the button. |
|
override |
Draws the background of a CallOutBox with a simple rounded rectangle and stroke.
call_out_box | The CallOutBox to draw. |
g | The Graphics context. |
path | The Path defining the callout shape. |
unused_image | Unused parameter. |
|
override |
Draws the background and arrow of a ComboBox.
g | The Graphics context. |
width | The width of the ComboBox. |
height | The height of the ComboBox. |
button_down | True if the mouse is down on the combo box. |
button_x,button_y,button_w,button_h | The button bounds within the combo box. |
box | The ComboBox to draw. |
|
override |
Draws the background for a popup menu with a rounded rectangle and border.
g | The Graphics context. |
width | The width of the popup menu. |
height | The height of the popup menu. |
|
overridevirtual |
Draws a custom scrollbar, potentially aligned differently if it's a LeftAlignedScrollBar.
g | The Graphics context. |
scroll_bar | The ScrollBar to draw. |
x,y,width,height | The bounds of the scrollbar. |
vertical | True if vertical scrollbar, false if horizontal. |
thumb_position | The current thumb position. |
thumb_size | The size of the thumb. |
mouse_over | True if mouse is over the scrollbar. |
mouse_down | True if mouse is clicked down on the scrollbar. |
|
inlineoverride |
Draws no outline for TextEditors by default.
|
override |
Draws a tick box (check box) with a filled rectangle if ticked.
g | The Graphics context. |
component | Reference to the parent component. |
x,y,w,h | The bounds of the tick box. |
ticked | True if the box is checked. |
enabled | True if the box is enabled. |
mouse_over | True if mouse is hovering. |
button_down | True if mouse is clicked down. |
|
override |
Fills the background of a TextEditor with a rounded rectangle and border.
g | The Graphics context. |
width | The width of the text editor. |
height | The height of the text editor. |
text_editor | Reference to the TextEditor. |
|
inlineoverride |
Returns the window flags for menu windows. Defaults to 0.
|
inlineoverridevirtual |
Returns the border size for popup menus.
|
override |
Returns the font to use for popup menus.
|
override |
Returns the font to use for slider popup text.
slider | Reference to the slider. |
|
override |
Gets the popup placement for a slider. Delegates to SynthSlider if present.
slider | The slider in question. |
|
inlinestatic |
Singleton instance accessor.
|
staticconstexpr |
Border size for popup menus.