Class WindowContentLayout
- Namespace
- SharpConsoleUI.Layout
- Assembly
- SharpConsoleUI.dll
Root layout for window content. Handles sticky top, scrollable middle, and sticky bottom sections.
public class WindowContentLayout : ILayoutContainer, IRegionClippingLayout
- Inheritance
-
WindowContentLayout
- Implements
- Inherited Members
Properties
CanScroll
Gets whether scrolling is needed.
public bool CanScroll { get; }
Property Value
MaxScrollOffset
Gets the maximum scroll offset.
public int MaxScrollOffset { get; }
Property Value
ScrollOffset
Gets or sets the current scroll offset for the scrollable section.
public int ScrollOffset { get; set; }
Property Value
ScrollableBottom
Gets the Y position where scrollable content ends (set during arrange).
public int ScrollableBottom { get; }
Property Value
ScrollableContentHeight
Gets the total height of scrollable content.
public int ScrollableContentHeight { get; }
Property Value
ScrollableTop
Gets the Y position where scrollable content starts (set during arrange).
public int ScrollableTop { get; }
Property Value
StickyBottomHeight
Gets the height of sticky bottom controls (set during arrange).
public int StickyBottomHeight { get; }
Property Value
StickyTopHeight
Gets the height of sticky top controls (set during arrange).
public int StickyTopHeight { get; }
Property Value
ViewportHeight
Gets the height of the scrollable viewport.
public int ViewportHeight { get; }
Property Value
Methods
ArrangeChildren(LayoutNode, LayoutRect)
Arranges children with sticky positioning.
public void ArrangeChildren(LayoutNode node, LayoutRect finalRect)
Parameters
nodeLayoutNodefinalRectLayoutRect
EnsureVisible(int)
Scrolls to ensure the specified Y position is visible in the scrollable area.
public void EnsureVisible(int y)
Parameters
yint
GetPaintClipRect(LayoutNode, LayoutRect)
Gets the paint clip rectangle for a child node based on its sticky position. This prevents scrollable content from painting over sticky regions.
public LayoutRect GetPaintClipRect(LayoutNode child, LayoutRect parentClipRect)
Parameters
childLayoutNodeThe child node to get the clip rectangle for.
parentClipRectLayoutRectThe parent's clip rectangle.
Returns
- LayoutRect
A restricted clip rectangle based on the child's sticky position.
MeasureChildren(LayoutNode, LayoutConstraints)
Measures all children and returns the total desired size.
public LayoutSize MeasureChildren(LayoutNode node, LayoutConstraints constraints)
Parameters
nodeLayoutNodeconstraintsLayoutConstraints
Returns
PageDown()
Scrolls down by one page.
public void PageDown()
PageUp()
Scrolls up by one page.
public void PageUp()
ScrollBy(int)
Scrolls by the specified amount.
public void ScrollBy(int delta)
Parameters
deltaint
ScrollToBottom()
Scrolls to the bottom.
public void ScrollToBottom()
ScrollToTop()
Scrolls to the top.
public void ScrollToTop()