class

CMiriScrollBarBehavior

Module
Miri
Header
#include "Miri/Widgets/CMiriScrollBarBehavior.h"
Namespace
Miri

Properties

TypeNameDescription
static constexpr floatMIN_THUMB_SIZEA thumb shorter than this cannot be grabbed, so its length is clamped and its travel derived from the clamped value. Default 24.0f.

Public functions

ReturnsNameDescription
voidSetTrackAbsolute track rect plus the sizes that set the thumb.
boolIsScrollable
boolIsEngagedTrue while the user is driving the bar — the owner must keep pointer capture and must not treat moves as anything else.
boolIsHighlightedTrue when the thumb should paint in its hovered/pressed colour.
const MiriRect&GetTrackRect
MiriRectGetThumbRect
floatGetMaxScrollOffset
floatGetScrollOffset
voidSetScrollOffset
boolOnPressedTrue when the bar took the press.
boolOnMovedTrue when the bar consumed the move (a drag, or a held track press).
voidOnReleased
EMiriCursorTypeGetCursorAtThe grab cursor over the thumb and while it is dragged, Default elsewhere — for the owner's OnCursorQuery.
voidAdvanceRuns the hold-to-repeat page timer; feed it the frame delta.

Function details

SetTrack

C++
void SetTrack(const MiriRect& trackRect, float viewportSize, float contentSize)

Absolute track rect plus the sizes that set the thumb. Widen the rect past the painted bar: it is the band that answers the mouse, and a 4 px thumb is not something anyone can hit.

IsScrollable

C++
bool IsScrollable() const

IsEngaged

C++
bool IsEngaged() const

True while the user is driving the bar — the owner must keep pointer capture and must not treat moves as anything else.

IsHighlighted

C++
bool IsHighlighted() const

True when the thumb should paint in its hovered/pressed colour.

GetTrackRect

C++
const MiriRect& GetTrackRect() const

GetThumbRect

C++
MiriRect GetThumbRect() const

GetMaxScrollOffset

C++
float GetMaxScrollOffset() const

GetScrollOffset

C++
float GetScrollOffset() const

SetScrollOffset

C++
void SetScrollOffset(float offset)

OnPressed

C++
bool OnPressed(const MiriVec2& pointer)

True when the bar took the press. The owner must not also treat the point as a click on the row underneath.

OnMoved

C++
bool OnMoved(const MiriVec2& pointer)

True when the bar consumed the move (a drag, or a held track press).

OnReleased

C++
void OnReleased()

GetCursorAt

C++
EMiriCursorType GetCursorAt(const MiriVec2& pointer) const

The grab cursor over the thumb and while it is dragged, Default elsewhere — for the owner's OnCursorQuery.

Advance

C++
void Advance(float deltaSeconds)

Runs the hold-to-repeat page timer; feed it the frame delta.

Generated from Miri/Widgets/CMiriScrollBarBehavior.h via miri.json · Dec 5, 2026Version 1.1.0