Handy.Clamp¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
The maximum size allocated to the child |
||
r/w/en |
The size from which the clamp will tighten its grip on the child |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Handy.Clamp(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A widget constraining its child to a given size.
The
HdyClamp
widget constrains the size of the widget it contains to a given maximum size. It will constrain the width if it is horizontal, or the height if it is vertical. The expansion of the child from its minimum to its maximum size is eased out for a smooth transition.If the child requires more than the requested maximum size, it will be allocated the minimum size it can fit in instead.
- CSS nodes
HdyClamp
has a single CSS node with nameclamp
.The node will get the style classes
.large
when its child reached its maximum size,.small
when the clamp allocates its full size to its child,.medium
in-between, or none if it didn’t compute its size yet.New in version 1.0.
- classmethod new()¶
- Returns:
the newly created
HdyClamp
- Return type:
Creates a new
HdyClamp
.New in version 1.0.
- get_maximum_size()¶
- Returns:
the maximum size to allocate to the children
- Return type:
Gets the maximum size allocated to the children.
New in version 1.0.
- get_tightening_threshold()¶
- Returns:
the size above which the children are clamped
- Return type:
Gets the size above which the children are clamped.
New in version 1.0.
Property Details¶
- Handy.Clamp.props.maximum_size¶
- Name:
maximum-size
- Type:
- Default Value:
600
- Flags:
The maximum size to allocate the children.
It is the width if the clamp is horizontal, or the height if it is vertical.
New in version 1.0.
- Handy.Clamp.props.tightening_threshold¶
- Name:
tightening-threshold
- Type:
- Default Value:
400
- Flags:
The size above which the child is clamped.
Starting from this size, the layout will tighten its grip on the children, slowly allocating less and less of the available size up to the maximum allocated size. Below that threshold and below the maximum size, the children will be allocated all the available size.
If the threshold is greater than the maximum size to allocate to the children, they will be allocated the whole size up to the maximum. If the threshold is lower than the minimum size to allocate to the children, that size will be used as the tightening threshold.
Effectively, tightening the grip on a child before it reaches its maximum size makes transitions to and from the maximum size smoother when resizing.
New in version 1.0.