Skip to content

NSStackView arranged-subview handling and layout diverge from AppKit #628

Description

@DTW-Thalion

Two problems in NSStackView beyond the state fixes in the linked PRs.

Arranged subviews: after -addArrangedSubview: on a plain -initWithFrame: stack view, -arrangedSubviews does not reliably report the added views and they are not left in -subviews as AppKit leaves them. The count comes out wrong, so membership cannot be relied on.

Layout: -_layoutViewsWithOrientation: is a custom pass that grows the stack view's own frame and positions the subviews by a running offset. It does not consult the distribution or alignment, and it does not build layout constraints, so the arranged geometry does not match AppKit's constraint-based model. Matching AppKit here would need a constraint-based rewrite rather than a small fix.

The scalar-state crash and default divergences are handled separately (empty-view setter crash and the initializer defaults).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions