Style

Contains the style for a node.

Members

Aliases

font
alias font = typeface
Undocumented in source.
loadFont
alias loadFont = loadTypeface
Undocumented in source.

Enums

Side
enum Side
Undocumented in source.
Themable
enum Themable
Undocumented in source.

Functions

contentBox
Vector2 contentBox(Vector2 size)

Remove padding from the vector representing size of a box.

contentBox
Rectangle contentBox(Rectangle rect)

Remove padding from the given rect.

drawBackground
void drawBackground(FluidBackend backend, Rectangle rect)

Draw the background & border.

drawLine
void drawLine(FluidBackend backend, Vector2 start, Vector2 end)

Draw a line.

fullMargin
float[4] fullMargin()

Get a side array holding both the regular margin and the border.

getTypeface
Typeface getTypeface()

Get current typeface, or fallback to default.

getTypeface
const(Typeface) getTypeface()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Style other)
Undocumented in source. Be warned that the author may not have intended to support it.
opacity
float opacity()
float opacity(float value)

Get or set node opacity. Value in range [0, 1] — 0 is fully transparent, 1 is fully opaque.

setDPI
void setDPI(Vector2 dpi)

Set current DPI.

totalMargin
float[4] totalMargin()

Get a sum of margin, border size and padding.

Static functions

cropBox
Vector2 cropBox(Vector2 size, float[4] sides)
Rectangle cropBox(Rectangle rect, float[4] sides)

Crop the given box by reducing its size on all sides.

defaultTypeface
Typeface defaultTypeface()
Undocumented in source. Be warned that the author may not have intended to support it.
loadTypeface
Typeface loadTypeface(string file)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

backgroundColor
Color backgroundColor;

Background color of the node.

border
float[4] border;

Border size, placed between margin and padding. [left, right, top, bottom].

borderStyle
FluidBorder borderStyle;

Border style to use.

breadcrumbs
Breadcrumbs breadcrumbs;

Breadcrumbs associated with this style. Used to keep track of tree-aware theme selectors, such as children. Does not include breadcrumbs loaded by parent nodes.

extra
Node.Extra extra;

Additional information for the node the style applies to.

fontSize
float fontSize;

Size of the font in use, in pixels.

gap
float[2] gap;

Margin/gap between two neighboring elements; for container nodes that support it.

lineColor
Color lineColor;

Color of lines belonging to the node, especially important to separators and sliders.

margin
float[4] margin;

Margin (outer margin) of the node. [left, right, top, bottom].

mouseCursor
FluidMouseCursor mouseCursor;

Cursor icon to use while this node is hovered.

padding
float[4] padding;

Padding (inner margin) of the node. [left, right, top, bottom].

selectionBackgroundColor
Color selectionBackgroundColor;

Background color for selected text.

textColor
Color textColor;

Text color.

tint
Color tint;

Apply tint to all node contents, including children.

typeface
Typeface typeface;

Main typeface to be used for text.

Meta