Skip to content

AScrollAreaViewport#

Inner component of AScrollArea that manages rendering and event handling with custom offset (scroll).

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

Detailed Description#

This view is intended to store only one single view with setContents()/contents() methods.

This view does not handle scroll events and touch events related to scroll. Use AScrollArea for such case.

Examples#

examples/ui/backdrop/src/main.cpp

Backdrop - Backdrop effects demo.

              Padding { 80_dp, 0, 0 },
            } AUI_LET { it->setExtraStylesheet(
                     AStylesheet {
                         {
                             t<AScrollAreaViewport>(),
                             AOverflow::VISIBLE,
                         },
                     }
                     ); },
        Vertical::Expanding {

Public Types#

Inner#


class AScrollAreaViewport::Inner

Empty structure.

Public Methods#

compensateLayoutUpdatesByScroll#


template<aui::invocable ApplyLayoutUpdate >
void AScrollAreaViewport::compensateLayoutUpdatesByScroll(_<AView> anchor, ApplyLayoutUpdate&& applyLayoutUpdate, glm::ivec2 diffMask = glm::ivec2(1, 1))

Compensates layout updates made in applyLayoutUpdate by scrolling by a diff of relative position of anchor.

Arguments
anchor
direct or indirect child used as an anchor.
applyLayoutUpdate
layout update procedure.
diffMask
mask that is used to control axes of the compensation. Default is `{1, 1}`.

Helps preventing visual layout jittering by querying relative to AScrollAreaViewport position of anchor before and after applyLayoutUpdate. The diff of relative position is then used to scroll the viewport, maintaining consistent visual position of anchor.

anchor must be direct or indirect child to this AScrollAreaViewport before and after applyLayoutUpdate.

The scroll operation made within this method does not prevent scroll animation nor kinetic effects.