Skip to content

AScrollbar#

A single scrollbar

Header:#include <AUI/View/AScrollbar.h>
CMake:aui_link(my_target PUBLIC aui::views)

Public Methods#

getMaxScroll#


std::size_t AScrollbar::getMaxScroll()
Returns
max scroll of this scrollbar.

If viewport size is larger than content size (in the case when contents are smaller than AScrollArea), 0 is returned.

setStickToEnd#


void AScrollbar::setStickToEnd(bool stickToEnd)

Set stick to end.

Arguments
stickToEnd

When scroll area dimensions is updated (an element added to scroll area) if the scrollbar was scrolled to the end (bottom) the scrollbar automatically scrolls to the ends, keeping the scroll position in place.

squeezeIntoCrossAxis#


void AScrollbar::squeezeIntoCrossAxis(AView& child)

Shrinks the child so that it does not stick out of our cross axis.

ass::FixedSize is law for AView::setSize, so a scrollbar that was laid out thinner than its chrome (i.e. an ass::FixedSize on the scrollbar itself) would have its arrows and handle sticking out. Writing the cross axis into the child's own fixed size instead would feed back into AScrollbar::chromeThickness, making this scrollbar remember its previous thickness, see AScrollbar::onLayout.