MenuPosition

Interfaces for positioning a menu within a window. This is the same purpose as the interface PopupPositionProvider, except Vertical and Horizontal separate out the positioning logic for each direction individually.

Types

Link copied to clipboard
fun interface Horizontal

An interface to calculate the horizontal position of a menu with respect to its anchor, window, and layout direction. The returned x-coordinate is relative to the window.

Link copied to clipboard
fun interface Vertical

An interface to calculate the vertical position of a menu with respect to its anchor and window. The returned y-coordinate is relative to the window.

Functions

Link copied to clipboard

Returns a MenuPosition.Vertical which aligns the bottom of the menu to the top of the anchor.

Link copied to clipboard

Returns a MenuPosition.Vertical which aligns the bottom of the menu to the bottom of the window.

Link copied to clipboard

Returns a MenuPosition.Vertical which aligns the center of the menu to the top of the anchor.

Link copied to clipboard

Returns a MenuPosition.Horizontal which aligns the end of the menu to the end of the anchor.

Link copied to clipboard

Returns a MenuPosition.Horizontal which aligns the left of the menu to the left of the window.

Link copied to clipboard

Returns a MenuPosition.Horizontal which aligns the right of the menu to the right of the window.

Link copied to clipboard

Returns a MenuPosition.Horizontal which aligns the start of the menu to the start of the anchor.

Link copied to clipboard

Returns a MenuPosition.Vertical which aligns the top of the menu to the bottom of the anchor.

Link copied to clipboard

Returns a MenuPosition.Vertical which aligns the top of the menu to the top of the window.