Adw.WrapBox (original) (raw)
Class
AdwWrapBox
since: 1.7
Description [src]
final class Adw.WrapBox : Gtk.Widget
implements Gtk.Accessible, Gtk.Buildable, Gtk.ConstraintTarget, Gtk.Orientable {
/* No available fields */
}
A box-like widget that can wrap into multiple lines.
AdwWrapBox
is similar to GtkBox, 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 GtkBox
, AdwWrapBox
is orientable and has spacing:
- AdwWrapBox:child-spacing between children in the same line;
- AdwWrapBox:line-spacing between lines.
Note
Unlike GtkBox
, AdwWrapBox
cannot follow the CSS border-spacing
property.
Use the AdwWrapBox:natural-line-length property to determine the layout’s natural size, e.g. when using it in a GtkPopover.
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 AdwWrapBox:pack-direction and AdwWrapBox:wrap-reverseproperties. Additionally, the alignment of each line can be controlled with the AdwWrapBox:align property.
Lines can be justified using the AdwWrapBox:justify property, filling the entire line by either increasing child size or spacing depending on the value. Set AdwWrapBox: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. SetAdwWrapBox: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, setAdwWrapBox:line-homogeneous to TRUE
.
Spacing and natural line length can scale with the text scale factor, use theAdwWrapBox:child-spacing-unit, AdwWrapBox:line-spacing-unitand/or AdwWrapBox:natural-line-length-unit properties to enable that behavior.
See AdwWrapLayout.
CSS nodes
AdwWrapBox
uses a single CSS node with name wrap-box
.
Accessibility
AdwWrapBox
uses the GTK_ACCESSIBLE_ROLE_GROUP
role.
Available since: 1.7
Constructors
Instance methods
adw_wrap_box_set_justify
Determines whether and how each complete line should be stretched to fill the entire widget.
since: 1.7
Methods inherited from GObject (43)
Please see GObject for a full list of methods.
Properties
Adw.WrapBox:justify
Determines whether and how each complete line should be stretched to fill the entire widget.
since: 1.7
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 AdwWrapBoxClass {
GtkWidgetClass parent_class;
}
No description available.
Class members
parent_class: GtkWidgetClass
No description available.