Handy.Squeezer¶
- Subclasses:
None
Methods¶
- Inherited:
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 |
Homogeneous sizing |
||
r/w/en |
Whether or not the size should smoothly change when changing between differently sized children |
||
r/w/en |
The animation duration, in milliseconds |
||
r |
Whether or not the transition is currently running |
||
r/w/en |
The type of animation used to transition |
||
r/en |
The widget currently visible in the squeezer |
||
r/w/en |
The horizontal alignment, from 0 (start) to 1 (end) |
||
r/w/en |
The vertical alignment, from 0 (top) to 1 (bottom) |
Child Properties¶
Name |
Type |
Default |
Flags |
Short Description |
|---|---|---|---|---|
|
r/w |
Whether the child can be picked or should be ignored when looking for the child fitting the available size best |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Handy.Squeezer(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A best fit container.
The
HdySqueezerwidget is a container which only shows the first of its children that fits in the available size. It is convenient to offer different widgets to represent the same data with different levels of detail, making the widget seem to squeeze itself to fit in the available space.Transitions between children can be animated as fades. This can be controlled with [method`Squeezer`.set_transition_type].
- CSS nodes
HdySqueezerhas a single CSS node with namesqueezer.Added in version 1.0.
- classmethod new()¶
- Returns:
the newly created
HdySqueezer- Return type:
Creates a new
HdySqueezer.Added in version 1.0.
- get_child_enabled(child)¶
- Parameters:
child (
Gtk.Widget) – a child of self- Returns:
whether child is enabled
- Return type:
Gets whether child is enabled.
See [method`Squeezer`.set_child_enabled].
Added in version 1.0.
- get_homogeneous()¶
- Returns:
whether self is homogeneous
- Return type:
Gets whether self is homogeneous.
Added in version 1.0.
- get_interpolate_size()¶
- Returns:
whether self interpolates its size on visible child change
- Return type:
Gets whether self should interpolate its size on visible child change.
Added in version 1.0.
- get_transition_duration()¶
- Returns:
the transition duration, in milliseconds
- Return type:
Gets the amount of time that transitions between children will take.
Added in version 1.0.
- get_transition_running()¶
- Returns:
whether a transition is currently running
- Return type:
Gets whether a transition is currently running for self.
Added in version 1.0.
- get_transition_type()¶
- Returns:
the current transition type of self
- Return type:
Gets the animation type that will be used for transitions between children.
Added in version 1.0.
- get_visible_child()¶
- Returns:
the visible child
- Return type:
Gtk.WidgetorNone
Gets the currently visible child of self.
Added in version 1.0.
- get_xalign()¶
- Returns:
the xalign property
- Return type:
Gets the horizontal alignment.
Added in version 1.0.
- get_yalign()¶
- Returns:
the yalign property
- Return type:
Gets the vertical alignment.
Added in version 1.0.
- set_child_enabled(child, enabled)¶
- Parameters:
child (
Gtk.Widget) – a child of selfenabled (
bool) – whether to enable the child
Sets whether child is enabled.
If a child is disabled, it will be ignored when looking for the child fitting the available size best. This allows to programmatically and prematurely hide a child of self even if it fits in the available space.
This can be used e.g. to ensure a certain child is hidden below a certain window width, or any other constraint you find suitable.
Added in version 1.0.
- set_homogeneous(homogeneous)¶
- Parameters:
homogeneous (
bool) –TRUEto make self homogeneous
Sets whether all children have the same size for the opposite orientation.
Added in version 1.0.
- set_interpolate_size(interpolate_size)¶
- Parameters:
interpolate_size (
bool) –TRUEto interpolate the size
Sets whether self should interpolate its size on visible child change.
Added in version 1.0.
- set_transition_duration(duration)¶
- Parameters:
duration (
int) – the new duration, in milliseconds
Sets the duration that transitions between children in self will take.
Added in version 1.0.
- set_transition_type(transition)¶
- Parameters:
transition (
Handy.SqueezerTransitionType) – the new transition type
Sets the animation type that will be used for transitions between children.
Added in version 1.0.
Property Details¶
- Handy.Squeezer.props.homogeneous¶
- Name:
homogeneous- Type:
- Default Value:
- Flags:
Whether all children have the same size for the opposite orientation.
For example, if a squeezer is horizontal and is homogeneous, it will request the same height for all its children. If it isn’t, the squeezer may change size when a different child becomes visible.
Added in version 1.0.
- Handy.Squeezer.props.interpolate_size¶
- Name:
interpolate-size- Type:
- Default Value:
- Flags:
Whether the squeezer interpolates its size when changing the visible child.
If
TRUE, the squeezer will interpolate its size between the one of the previous visible child and the one of the new visible child, according to the set transition duration and the orientation, e.g. if the squeezer is horizontal, it will interpolate the its height.Added in version 1.0.
- Handy.Squeezer.props.transition_duration¶
- Name:
transition-duration- Type:
- Default Value:
200- Flags:
The animation duration, in milliseconds.
Added in version 1.0.
- Handy.Squeezer.props.transition_running¶
-
Whether a transition is currently running.
Added in version 1.0.
- Handy.Squeezer.props.transition_type¶
- Name:
transition-type- Type:
- Default Value:
- Flags:
The type of animation used for transitions between children.
Available types include various kinds of fades and slides.
The transition type can be changed without problems at runtime, so it is possible to change the animation based on the child that is about to become current.
Added in version 1.0.
- Handy.Squeezer.props.visible_child¶
- Name:
visible-child- Type:
- Default Value:
- Flags:
The currently visible child.
Added in version 1.0.
- Handy.Squeezer.props.xalign¶
- Name:
xalign- Type:
- Default Value:
0.5- Flags:
The horizontal alignment, from 0 (start) to 1 (end).
The xalign property determines the horizontal alignment of the children inside the squeezer’s size allocation. Compare this to [property`Gtk`.Widget:halign], which determines how the squeezer’s size allocation is positioned in the space available for the squeezer.
This will affect the position of children too wide to fit in the squeezer as they are fading out.
Added in version 1.0.
- Handy.Squeezer.props.yalign¶
- Name:
yalign- Type:
- Default Value:
0.5- Flags:
The vertical alignment, from 0 (start) to 1 (end).
The yalign property determines the vertical alignment of the children inside the squeezer’s size allocation. Compare this to [property`Gtk`.Widget:valign], which determines how the squeezer’s size allocation is positioned in the space available for the squeezer.
This will affect the position of children too tall to fit in the squeezer as they are fading out.
Added in version 1.0.