Skip to content

feat: stack layout with sizing rules #87

Closed

Description

@octalide

What

Layout is columns and a vertical cursor, held as loose fields on the context (ox, oy, cx, cy, pw) that each container saves and restores by hand. begin_panel does not save them at all, so a panel inside a window overwrites the window's layout. Toolbars, forms and panels also need horizontal stacks, alignment and sizing rules without hand-computed coordinates.

A single-pass immediate-mode layout cannot know a container's content size before placing it, so fit-content sizing and center or end alignment read the size measured last frame from the state store (#95) and settle one frame after content changes, as Dear ImGui's auto-fit does.

Acceptance

  • A layout stack on the context that every container (panel, window, popup, dock, scroll region, columns) pushes and pops, replacing the loose cursor fields, with a test nesting a panel in a window
  • Horizontal and vertical stacks that nest, each with spacing and alignment (start, center, end, stretch)
  • Sizing per item: fixed, fit content, fill, and a fraction of the remaining space, with min and max
  • Same-line placement, as ImGui's SameLine, for quick inline rows
  • Layout reads its gaps and padding from the style system
  • Existing column helpers keep working on top of the new layout, so current callers do not change

Activity

  1. added
    minorBackwards-compatible new feature or capability
    featureNew capability or feature addition
    on Oct 1, 2026
  2. added a commit that references this issue on Oct 1, 2026
  3. added 3 commits that reference this issue on Oct 1, 2026
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

    featureNew capability or feature additionminorBackwards-compatible new feature or capability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions