5#include "flint/core/api.h"
6#include "flint/ui/ui-node.h"
33 float trackHeight = 6.f;
34 float thumbWidth = 8.f;
35 float thumbHeight = 6.f;
36 Color trackColor = {70, 70, 70, 255};
37 Color fillColor = {180, 180, 180, 255};
38 Color thumbColor = {230, 230, 230, 255};
51 FLINT_API
void setTrackHeight(
float height);
52 FLINT_API
void setThumbWidth(
float width);
53 FLINT_API
void setThumbHeight(
float height);
54 FLINT_API
void setThumbColor(const
Color &color);
55 FLINT_API
void setFillColor(const
Color &color);
56 FLINT_API
void setTrackColor(const
Color &color);
72 [[nodiscard]]
const SliderStyle &getStyle()
const {
111 FLINT_API
void onChange(std::function<
void(
float)> callback);
121 void setValueInternal(
float value,
bool notify);
122 void updateValueFromMouse(
Vec2f mousePosition);
123 [[nodiscard]]
float getNormalizedValue()
const;
126 SliderStyle m_sliderStyle{};
129 bool m_dragging =
false;
130 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,...
An interactive value-selector bar supporting mouse dragging and gamepad focus adjustments.
FLINT_API void handleEvent(const UIEvent &event) override
Routes interaction updates, translating drag motions and directional navigations.
FLINT_API void setRange(float min, float max)
Sets the absolute functional minimum and maximum selection boundaries.
FLINT_API const Color & currentColor() const override
Resolves handle colors by evaluating hover, active focus, and dragging parameters.
const float & getValue() const
Gets the current stepped, clamped value of the slider.
FLINT_API void setProperties(SliderProperties properties)
Assigns minimum, maximum, and quantization stepping properties.
FLINT_API float applyStep(float value) const
Snaps a raw value to the nearest incremental step boundary configuration.
FLINT_API void setStyle(const SliderStyle &style)
Overrides the visual style parameters for the track and slider handles.
FLINT_API bool hitTest(Vec2f point) const override
Computes true if a vector coordinate sits inside the spatial arrangement bounding tracking layout box...
FLINT_API void setValue(float value)
Sets the tracking selection value directly, applying steps and clamps.
FLINT_API void onChange(std::function< void(float)> callback)
Registers a function callback to execute whenever the slider value mutations occur.
bool consumesDirectionalInput() const override
Dictates whether this widget captures directional inputs instead of passing them to focus navigation.
FLINT_API void render(UICanvas &canvas) const override
Draws the slider track background, active fill bar, and handle quad.
bool isFocusable() const override
Dictates if keyboard selection trackers or gamepad vectors can snap control focuses onto this item.
FLINT_API void measure(UIConstraints constraints) override
Pass 1 of the layout engine: Crawls branches recursively to compute base display boundaries requested...
FLINT_API void arrange(const Rect< float > &rect) override
Pass 2 of the layout engine: Evaluates layout adjustments to pin final screen coordinate values to th...
FLINT_API void setFocused(bool focused) override
Sets whether this node is currently focused.
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.