4#include "flint/ui/ui-node.h"
31 float trackHeight = 6.f;
32 float thumbWidth = 8.f;
33 float thumbHeight = 6.f;
34 Color trackColor = {70, 70, 70, 255};
35 Color fillColor = {180, 180, 180, 255};
36 Color thumbColor = {230, 230, 230, 255};
49 void setTrackHeight(
float height);
50 void setThumbWidth(
float width);
51 void setThumbHeight(
float height);
52 void setThumbColor(const
Color &color);
53 void setFillColor(const
Color &color);
54 void setTrackColor(const
Color &color);
70 [[nodiscard]]
const SliderStyle &getStyle()
const {
109 void onChange(std::function<
void(
float)> callback);
119 void setValueInternal(
float value,
bool notify);
120 void updateValueFromMouse(
Vec2f mousePosition);
121 [[nodiscard]]
float getNormalizedValue()
const;
124 SliderStyle m_sliderStyle{};
127 bool m_dragging =
false;
128 std::function<void(
float)> m_onChange;
Dynamic 2D batching engine processing shape vector geometry and hardware-accelerated text strings....
Abstract base class for all UI widgets, managing hierarchy tracking, layout passes,...
void render(UICanvas &canvas) const override
Draws the slider track background, active fill bar, and handle quad.
const Color & currentColor() const override
Resolves handle colors by evaluating hover, active focus, and dragging parameters.
void measure(UIConstraints constraints) override
Pass 1 of the layout engine: Crawls branches recursively to compute base display boundaries requested...
bool hitTest(Vec2f point) const override
Computes true if a vector coordinate sits inside the spatial arrangement bounding tracking layout box...
float applyStep(float value) const
Snaps a raw value to the nearest incremental step boundary configuration.
const float & getValue() const
Gets the current stepped, clamped value of the slider.
void setFocused(bool focused) override
Sets whether this node is currently focused.
void arrange(const Rect< float > &rect) override
Pass 2 of the layout engine: Evaluates layout adjustments to pin final screen coordinate values to th...
bool consumesDirectionalInput() const override
Dictates whether this widget captures directional inputs instead of passing them to focus navigation.
bool isFocusable() const override
Dictates if keyboard selection trackers or gamepad vectors can snap control focuses onto this item.
void handleEvent(const UIEvent &event) override
Routes interaction updates, translating drag motions and directional navigations.
An interactive value-selector bar supporting mouse dragging and gamepad focus adjustments.
void setProperties(SliderProperties properties)
Assigns minimum, maximum, and quantization stepping properties.
void onChange(std::function< void(float)> callback)
Registers a function callback to execute whenever the slider value mutations occur.
void setStyle(const SliderStyle &style)
Overrides the visual style parameters for the track and slider handles.
void setRange(float min, float max)
Sets the absolute functional minimum and maximum selection boundaries.
void setValue(float value)
Sets the tracking selection value directly, applying steps and clamps.
RGBA color with 8-bit unsigned components.
Generic axis-aligned rectangle defined by a position and size.
Represents the boundary budget passed down the node tree during layout allocation.
A normalized data packet containing translated input data routed down the UI node tree.
Architectural constraints governing value clamping and stepping metrics.
Visual properties defining the slider track, fill area, and thumb indicator.