Top | ![]() |
![]() |
![]() |
![]() |
GtkWidget * | hdy_clamp_new () |
gint | hdy_clamp_get_maximum_size () |
void | hdy_clamp_set_maximum_size () |
gint | hdy_clamp_get_tightening_threshold () |
void | hdy_clamp_set_tightening_threshold () |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── HdyClamp
The HdyClamp widget constraints 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.
HdyClamp has a single CSS node with name clamp. 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.
gint
hdy_clamp_get_maximum_size (HdyClamp *self
);
Gets the maximum size to allocate to the contained child. It is the width if
self
is horizontal, or the height if it is vertical.
Since: 1.0
void hdy_clamp_set_maximum_size (HdyClamp *self
,gint maximum_size
);
Sets the maximum size to allocate to the contained child. It is the width if
self
is horizontal, or the height if it is vertical.
Since: 1.0
gint
hdy_clamp_get_tightening_threshold (HdyClamp *self
);
Gets the size starting from which the clamp will tighten its grip on the child.
Since: 1.0
“maximum-size”
property “maximum-size” int
The maximum size to allocate to the child. It is the width if the clamp is horizontal, or the height if it is vertical.
Owner: HdyClamp
Flags: Read / Write
Allowed values: >= 0
Default value: 600
Since: 1.0
“tightening-threshold”
property “tightening-threshold” int
The size starting from which the clamp will tighten its grip on the child, slowly allocating less and less of the available size up to the maximum allocated size. Below that threshold and below the maximum width, the child will be allocated all the available size.
If the threshold is greater than the maximum size to allocate to the child, the child will be allocated all the width up to the maximum. If the threshold is lower than the minimum size to allocate to the child, that size will be used as the tightening threshold.
Effectively, tightening the grip on the child before it reaches its maximum size makes transitions to and from the maximum size smoother when resizing.
Owner: HdyClamp
Flags: Read / Write
Allowed values: >= 0
Default value: 400
Since: 1.0