LavaUI docs GitHub

struct WindowDragArea

Swift

struct WindowDragArea<Content> where Content : View

Makes a view's empty space a place the window can be dragged by.

The other half of client-side decoration, and the half that is easy to forget: without it a window with no title bar can be closed and maximized but never moved. Put it on the toolbar, the header, or whatever row the controls sit in — anything interactive inside still wins, because the hit test reaches children first.

The press is all it takes. From the moment the compositor is told, the pointer is the compositor's: the motion never reaches this process, the window follows the cursor, and the drag ends when the button comes up somewhere this app will never hear about. That is why nothing here tracks a drag — there is none to track on this side.

Sources/LavaUI/WindowControls.swift:411

Constructors

init(content: Content, doubleClickMaximizes: Bool = true)

Makes content a handle that moves the window. Usually spelled .windowDrag().

Sources/LavaUI/WindowControls.swift:423

Properties

var content: Content

The view that drags the window.

Sources/LavaUI/WindowControls.swift:413

var doubleClickMaximizes: Bool

Whether a double-click toggles maximize, the way a title bar does.

Sources/LavaUI/WindowControls.swift:415

var dumpDetail: String { get }

Not documented.

Sources/LavaUI/WindowControls.swift:428

Methods

func mountPrimitive() -> any AnyViewNode

Not documented.

Sources/LavaUI/WindowControls.swift:437

func reconcilePrimitive(_ node: any AnyViewNode) -> any AnyViewNode

Not documented.

Sources/LavaUI/WindowControls.swift:441

func structureLines(indent: Int = 0) -> [String]

Not documented.

Sources/LavaUI/WindowControls.swift:430