MenuAnchorPosition.Custom


A custom positioning strategy

This allows for dynamic positioning logic that can adapt to the anchor's location on screen, the available window space, and the size of the menu content.

Please adjust xCandidates and yCandidates to the current LayoutDirection if needed.

Summary

Public constructors

Custom(
    xCandidates: (anchorBounds: IntRect, windowSize: IntSize, menuSize: IntSize) -> IntList,
    yCandidates: (anchorBounds: IntRect, windowSize: IntSize, menuSize: IntSize) -> IntList
)
Cmn

Public functions

open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn

Public properties

(anchorBounds: IntRect, windowSize: IntSize, menuSize: IntSize) -> IntList

A lambda that calculates a list of preferred X (horizontal) coordinates.

Cmn
(anchorBounds: IntRect, windowSize: IntSize, menuSize: IntSize) -> IntList

A lambda that calculates a list of preferred Y (vertical) coordinates.

Cmn

Public constructors

Custom

Custom(
    xCandidates: (anchorBounds: IntRect, windowSize: IntSize, menuSize: IntSize) -> IntList,
    yCandidates: (anchorBounds: IntRect, windowSize: IntSize, menuSize: IntSize) -> IntList
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

Public properties

xCandidates

val xCandidates: (anchorBounds: IntRect, windowSize: IntSize, menuSize: IntSize) -> IntList

A lambda that calculates a list of preferred X (horizontal) coordinates. The system will iterate through these candidates to find the best fit within the window bounds. The lambda receives: anchorBounds: The position and size of the anchor element in window coordinates. windowSize: The total available size of the window/screen. menuSize: The measured size of the menu content.

yCandidates

val yCandidates: (anchorBounds: IntRect, windowSize: IntSize, menuSize: IntSize) -> IntList

A lambda that calculates a list of preferred Y (vertical) coordinates. The system will iterate through these candidates to find the best fit within the window bounds. The lambda receives: anchorBounds: The position and size of the anchor element in window coordinates. windowSize: The total available size of the window/screen. menuSize: The measured size of the menu content.