Class

AdwWrapLayout

unstable since: 1.7

Description [src]

final class Adw.WrapLayout : Gtk.LayoutManager
  implements Gtk.Orientable {
  /* No available fields */
}

A box-like layout that can wrap into multiple lines.

wrap-box

AdwWrapLayout is similar to GtkBoxLayout, but can wrap lines when the widgets cannot fit otherwise. Unlike GtkFlowBox, the children aren’t arranged into a grid and behave more like words in a wrapping label.

Like GtkBoxLayout, AdwWrapLayout is orientable and has spacing:

Note

Unlike GtkBoxLayout, AdwWrapLayout cannot follow the CSS border-spacing property.

Use the AdwWrapLayout:natural-line-length property to determine the layout’s natural size, e.g. when using it in a GtkPopover.

Normally, a horizontal AdwWrapLayout wraps left to right and top to bottom for left-to-right languages. Both of these directions can be reversed, using the AdwWrapLayout:pack-direction and AdwWrapLayout:wrap-reverse properties. Additionally, the alignment of each line can be controlled with the AdwWrapLayout:align property.

Lines can be justified using the AdwWrapLayout:justify property, filling the entire line by either increasing child size or spacing depending on the value. Set AdwWrapLayout:justify-last-line to justify the last line as well.

By default, AdwWrapLayout wraps as soon as the previous line cannot fit any more children without shrinking them past their natural size. Set AdwWrapLayout:wrap-policy to ADW_WRAP_MINIMUM to only wrap once all the children in the previous line have been shrunk to their minimum size.

To make each line take the same amount of space, set AdwWrapLayout:line-homogeneous to TRUE.

Spacing and natural line length can scale with the text scale factor, use the AdwWrapLayout:child-spacing-unit, AdwWrapLayout:line-spacing-unit and/or AdwWrapLayout:natural-line-length-unit properties to enable that behavior.

See AdwWrapBox.

Available since: 1.7

Hierarchy

hierarchy this AdwWrapLayout implements_0 GtkOrientable this--implements_0 ancestor_0 GtkLayoutManager ancestor_0--this ancestor_1 GObject ancestor_1--ancestor_0

Implements

Constructors

adw_wrap_layout_new

Creates a new AdwWrapLayout.

unstable since: 1.7

Instance methods

adw_wrap_layout_get_align

Gets the alignment of the children within each line.

unstable since: 1.7

adw_wrap_layout_get_child_spacing

Gets spacing between widgets on the same line.

unstable since: 1.7

adw_wrap_layout_get_child_spacing_unit

Gets the length unit for child spacing.

unstable since: 1.7

adw_wrap_layout_get_justify

Gets whether and how each complete line is stretched to fill the entire widget.

unstable since: 1.7

adw_wrap_layout_get_justify_last_line

Gets whether the last line should be stretched to fill the entire widget.

unstable since: 1.7

adw_wrap_layout_get_line_homogeneous

Gets whether all lines should take the same amount of space.

unstable since: 1.7

adw_wrap_layout_get_line_spacing

Gets the spacing between lines.

unstable since: 1.7

adw_wrap_layout_get_line_spacing_unit

Gets the length unit for line spacing.

unstable since: 1.7

adw_wrap_layout_get_natural_line_length

Gets the natural size for each line.

unstable since: 1.7

adw_wrap_layout_get_natural_line_length_unit

Gets the length unit for line spacing.

unstable since: 1.7

adw_wrap_layout_get_pack_direction

Gets the direction children are packed in each line.

unstable since: 1.7

adw_wrap_layout_get_wrap_policy

Gets the policy for line wrapping.

unstable since: 1.7

adw_wrap_layout_get_wrap_reverse

Gets whether wrap direction is reversed.

unstable since: 1.7

adw_wrap_layout_set_align

Sets the alignment of the children within each line.

unstable since: 1.7

adw_wrap_layout_set_child_spacing

Sets the spacing between widgets on the same line.

unstable since: 1.7

adw_wrap_layout_set_child_spacing_unit

Sets the length unit for child spacing.

unstable since: 1.7

adw_wrap_layout_set_justify

Sets whether and how each complete line should be stretched to fill the entire widget.

unstable since: 1.7

adw_wrap_layout_set_justify_last_line

Sets whether the last line should be stretched to fill the entire widget.

unstable since: 1.7

adw_wrap_layout_set_line_homogeneous

Sets whether all lines should take the same amount of space.

unstable since: 1.7

adw_wrap_layout_set_line_spacing

Sets the spacing between lines.

unstable since: 1.7

adw_wrap_layout_set_line_spacing_unit

Sets the length unit for line spacing.

unstable since: 1.7

adw_wrap_layout_set_natural_line_length

Sets the natural size for each line.

unstable since: 1.7

adw_wrap_layout_set_natural_line_length_unit

Sets the length unit for natural line length.

unstable since: 1.7

adw_wrap_layout_set_pack_direction

Sets the direction children are packed in each line.

unstable since: 1.7

adw_wrap_layout_set_wrap_policy

Sets the policy for line wrapping.

unstable since: 1.7

adw_wrap_layout_set_wrap_reverse

Sets whether wrap direction should be reversed.

unstable since: 1.7

Methods inherited from GtkLayoutManager (6)
gtk_layout_manager_allocate

Assigns the given width, height, and baseline to a widget, and computes the position and sizes of the children of the widget using the layout management policy of manager.

gtk_layout_manager_get_layout_child

Retrieves a GtkLayoutChild instance for the GtkLayoutManager, creating one if necessary.

gtk_layout_manager_get_request_mode

Retrieves the request mode of manager.

gtk_layout_manager_get_widget

Retrieves the GtkWidget using the given GtkLayoutManager.

gtk_layout_manager_layout_changed

Queues a resize on the GtkWidget using manager, if any.

gtk_layout_manager_measure

Measures the size of the widget using manager, for the given orientation and size.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Methods inherited from GtkOrientable (2)
gtk_orientable_get_orientation

Retrieves the orientation of the orientable.

gtk_orientable_set_orientation

Sets the orientation of the orientable.

Properties

Adw.WrapLayout:align

The alignment of the children within each line.

unstable since: 1.7

Adw.WrapLayout:child-spacing

The spacing between widgets on the same line.

unstable since: 1.7

Adw.WrapLayout:child-spacing-unit

The length unit for child spacing.

unstable since: 1.7

Adw.WrapLayout:justify

Determines whether and how each complete line should be stretched to fill the entire widget.

unstable since: 1.7

Adw.WrapLayout:justify-last-line

Whether the last line should be stretched to fill the entire widget.

unstable since: 1.7

Adw.WrapLayout:line-homogeneous

Whether all lines should take the same amount of space.

unstable since: 1.7

Adw.WrapLayout:line-spacing

The spacing between lines.

unstable since: 1.7

Adw.WrapLayout:line-spacing-unit

The length unit for line spacing.

unstable since: 1.7

Adw.WrapLayout:natural-line-length

Determines the natural size for each line.

unstable since: 1.7

Adw.WrapLayout:natural-line-length-unit

The length unit for natural line length.

unstable since: 1.7

Adw.WrapLayout:pack-direction

The direction children are packed in each line.

unstable since: 1.7

Adw.WrapLayout:wrap-policy

Whether wrap direction should be reversed.

unstable since: 1.7

Adw.WrapLayout:wrap-reverse

Whether wrap direction should be reversed.

unstable since: 1.7

Properties inherited from GtkOrientable (1)
Gtk.Orientable:orientation

The orientation of the orientable.

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct AdwWrapLayoutClass {
  GtkLayoutManagerClass parent_class;
  
}

No description available.

Class members
parent_class: GtkLayoutManagerClass

No description available.