Skip to content

Add width and height as pseudo-units or constants for layout arithmetic #403

@sparr

Description

@sparr

Is your feature request related to a problem? Please describe.
I have a layout defined as half the width of another layout, and I want to use it for both the left and right halves. Currently I have to explicitly set x: +=123 on the right half, where 123 is the width of that layout.

Describe the solution you'd like
I would like to be able to do x: +=width. It seems like the shortest path to making that work would be the units system, where width would work like cell but with its multiplier set to the current layout width. Ditto for height. This approach might require users to do x: +=1width, or it might require extending the unit system to allow omitting the 1 value which would also allow x: +=px or x: +=cell.

Describe alternatives you've considered
This could be done with a new parsing path altogether, allowing width and height in place of numerical constants. That might have desirable other use cases.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions