Package org.gnome.adw

Class WrapBox

java.lang.Object
All Implemented Interfaces:
Proxy, Accessible, Buildable, ConstraintTarget, Orientable

@Generated("io.github.jwharm.JavaGI") public class WrapBox extends Widget implements Accessible, Buildable, ConstraintTarget, Orientable
A box-like widget that can wrap into multiple lines.

wrap-box

AdwWrapBox is similar to Box, but can wrap lines when the widgets cannot fit otherwise. Unlike FlowBox, the children aren't arranged into a grid and behave more like words in a wrapping label.

Like GtkBox, AdwWrapBox is orientable and has spacing:

  • WrapBox:child-spacing between children in the same line;
  • WrapBox:line-spacing between lines.

Note Unlike GtkBox, AdwWrapBox cannot follow the CSS border-spacing property. Use the [property@WrapBox:natural-line-length] property to determine the layout's natural size, e.g. when using it in a [class@Gtk.Popover]. Normally, a horizontal AdwWrapBox wraps left to right and top to bottom for left-to-right languages. Both of these directions can be reversed, using the [property@WrapBox:pack-direction] and [property@WrapBox:wrap-reverse] properties. Additionally, the alignment of each line can be controlled with the [property@WrapBox:align] property. Lines can be justified using the [property@WrapBox:justify] property, filling the entire line by either increasing child size or spacing depending on the value. Set [property@WrapBox:justify-last-line] to justify the last line as well. By default, AdwWrapBox wraps as soon as the previous line cannot fit any more children without shrinking them past their natural size. Set [property@WrapBox:wrap-policy] to [enum@Adw.WrapPolicy.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 [property@WrapBox:line-homogeneous] to TRUE. Spacing and natural line length can scale with the text scale factor, use the [property@WrapBox:child-spacing-unit], [property@WrapBox:line-spacing-unit] and/or [property@WrapBox:natural-line-length-unit] properties to enable that behavior. See [class@WrapLayout]. ## CSS nodes AdwWrapBox uses a single CSS node with name wrap-box. ## Accessibility AdwWrapBox uses the GTK_ACCESSIBLE_ROLE_GROUP role.

Since:
1.7