Adw.ClampScrollable

g Adw.ClampScrollable Adw.ClampScrollable GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable Gtk.Scrollable Gtk.Scrollable GObject.GInterface->Gtk.Scrollable GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Orientable->Adw.ClampScrollable Gtk.Scrollable->Adw.ClampScrollable Gtk.Widget->Adw.ClampScrollable

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Orientable (2), Gtk.Scrollable (9)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

get_child ()

get_maximum_size ()

get_tightening_threshold ()

get_unit ()

set_child (child)

set_maximum_size (maximum_size)

set_tightening_threshold (tightening_threshold)

set_unit (unit)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9), Gtk.Scrollable (1)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1), Gtk.Orientable (1), Gtk.Scrollable (4)

Name

Type

Flags

Short Description

child

Gtk.Widget

r/w/en

maximum-size

int

r/w/en

tightening-threshold

int

r/w/en

unit

Adw.LengthUnit

r/w/en

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class Adw.ClampScrollable(**kwargs)
Bases:

Gtk.Widget, Gtk.Orientable, Gtk.Scrollable

Abstract:

No

Structure:

Adw.ClampScrollableClass

A scrollable [class`Clamp`].

AdwClampScrollable is a variant of [class`Clamp`] that implements the [iface`Gtk`.Scrollable] interface.

The primary use case for AdwClampScrollable is clamping [class`Gtk`.ListView].

classmethod new()
Returns:

the newly created AdwClampScrollable

Return type:

Gtk.Widget

Creates a new AdwClampScrollable.

get_child()
Returns:

the child widget of self

Return type:

Gtk.Widget or None

Gets the child widget of self.

get_maximum_size()
Returns:

the maximum size to allocate to the child

Return type:

int

Gets the maximum size allocated to the child.

get_tightening_threshold()
Returns:

the size above which the child is clamped

Return type:

int

Gets the size above which the child is clamped.

get_unit()
Returns:

the length unit

Return type:

Adw.LengthUnit

Gets the length unit for maximum size and tightening threshold.

New in version 1.4.

set_child(child)
Parameters:

child (Gtk.Widget or None) – the child widget

Sets the child widget of self.

set_maximum_size(maximum_size)
Parameters:

maximum_size (int) – the maximum size

Sets the maximum size allocated to the child.

It is the width if the clamp is horizontal, or the height if it is vertical.

set_tightening_threshold(tightening_threshold)
Parameters:

tightening_threshold (int) – the tightening threshold

Sets the size above which the child is clamped.

Starting from this size, 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.

set_unit(unit)
Parameters:

unit (Adw.LengthUnit) – the length unit

Sets the length unit for maximum size and tightening threshold.

Allows the sizes to vary depending on the text scale factor.

New in version 1.4.

Property Details

Adw.ClampScrollable.props.child
Name:

child

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The child widget of the AdwClampScrollable.

Adw.ClampScrollable.props.maximum_size
Name:

maximum-size

Type:

int

Default Value:

600

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The maximum size allocated to the child.

It is the width if the clamp is horizontal, or the height if it is vertical.

Adw.ClampScrollable.props.tightening_threshold
Name:

tightening-threshold

Type:

int

Default Value:

400

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The size above which the child is clamped.

Starting from this size, 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.

Adw.ClampScrollable.props.unit
Name:

unit

Type:

Adw.LengthUnit

Default Value:

Adw.LengthUnit.SP

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The length unit for maximum size and tightening threshold.

Allows the sizes to vary depending on the text scale factor.

New in version 1.4.