2023-10-29 10:00:34 +00:00
|
|
|
UI_Column()
|
|
|
|
{
|
|
|
|
UI_Spacer(UI_Em(1, 1));
|
|
|
|
UI_Height(UI_Em(1, 1)) UI_Row()
|
|
|
|
{
|
|
|
|
UI_Width(UI_TextContent(15, 1)) UI_LabelF("Scrollbar T:");
|
|
|
|
|
|
|
|
UI_SetNextWidth(UI_Em(20, 1));
|
|
|
|
UI_SetNextCornerRadius(UI_TopFontSize()*0.5f);
|
|
|
|
ui_box *Container = UI_MakeBoxF(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder, "Scrollable");
|
|
|
|
UI_Parent(Container)
|
|
|
|
{
|
|
|
|
UI_SetNextCornerRadius(UI_TopFontSize()*0.5f);
|
|
|
|
UI_SetNextSize(UI_Em(1, 1), UI_Em(1, 1));
|
|
|
|
UI_SetNextFixedX((DimOfRange(Container->Rect).x-UI_TopFontSize())*ScrollbarT);
|
|
|
|
ui_box *Box = UI_MakeBoxF(UI_BoxFlag_DrawBackground|
|
|
|
|
UI_BoxFlag_DrawBorder|
|
|
|
|
UI_BoxFlag_HotAnimation|
|
|
|
|
UI_BoxFlag_ActiveAnimation|
|
|
|
|
UI_BoxFlag_Clickable|
|
|
|
|
UI_BoxFlag_FloatingX|
|
|
|
|
0, "Dragable");
|
|
|
|
ui_signal Signal = UI_SignalFromBox(Box);
|
|
|
|
if(Signal.Dragging)
|
|
|
|
{
|
|
|
|
if(Signal.Pressed)
|
|
|
|
{
|
|
|
|
UI_StoreDragR32(ScrollbarT);
|
|
|
|
}
|
|
|
|
|
|
|
|
r32 StartT = UI_GetDragR32();
|
|
|
|
r32 EndT = StartT + Signal.DragDelta.x/(DimOfRange(Container->Rect).x-UI_TopFontSize());
|
|
|
|
ScrollbarT = Clamp01(EndT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
UI_Width(UI_TextContent(30, 1)) UI_Height(UI_Em(2, 1))
|
|
|
|
{
|
|
|
|
if(UI_ButtonF("Reset Dialog").Pressed)
|
|
|
|
{
|
|
|
|
Time = 0.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|