wijjit.layout.bounds.Size
- class wijjit.layout.bounds.Size(value)[source]
Represents a size specification for layout calculation.
This can represent fixed sizes, percentages, or fill behavior.
- Parameters:
value (
intorstr) – Size value (integer for fixed, “fill” for remaining space, or percentage string like “50%”)- Variables:
Methods
__init__(value)calculate(available)Calculate the actual size given available space.
Get the percentage value (0.0 to 1.0).
Attributes
Check if this should fill available space.
Check if this is a fixed size.
Check if this is a percentage size.
- property is_fill: bool
Check if this should fill available space.
- Returns:
True if fill mode
- Return type:
- property is_percentage: bool
Check if this is a percentage size.
- Returns:
True if percentage
- Return type:
- get_percentage()[source]
Get the percentage value (0.0 to 1.0).
- Returns:
Percentage as decimal
- Return type:
- Raises:
ValueError – If not a percentage size