wijjit.layout.engine.SizeConstraints
- class wijjit.layout.engine.SizeConstraints(min_width, min_height, preferred_width=None, preferred_height=None, content_min_width=None, content_min_height=None)[source]
Size constraints for layout calculation.
- Parameters:
min_width (
int) – Minimum width requiredmin_height (
int) – Minimum height requiredpreferred_width (
int, optional) – Preferred width (default: min_width)preferred_height (
int, optional) – Preferred height (default: min_height)content_min_width (
int, optional) – Width below which the node’s content cannot be shown, ignoring any explicit fixedwidthspec (default:min_width).content_min_height (
int, optional) – Height below which the node’s content cannot be shown, ignoring any explicit fixedheightspec (default:min_height).
- Variables:
min_width (
int) – Minimum width requiredmin_height (
int) – Minimum height requiredpreferred_width (
int) – Preferred widthpreferred_height (
int) – Preferred heightcontent_min_width (
int) – Natural content minimum width (the auto-fit shrink floor)content_min_height (
int) – Natural content minimum height (the auto-fit shrink floor)
Notes
A node with a fixed
width/heightspec reports that value as bothmin_*andpreferred_*, which makes it look incompressible. Thecontent_min_*pair records what the node would need if the author had not pinned a size, and is what auto-fit (seeshrink_to_fit()) uses as the floor when it has to claw back over-committed space.- __init__(min_width, min_height, preferred_width=None, preferred_height=None, content_min_width=None, content_min_height=None)
Methods
__init__(min_width, min_height[, ...])Attributes