pub struct WrapBoxBuilder { /* private fields */ }
v1_7
only.Expand description
A builder-pattern type to construct WrapBox
objects.
Implementations§
source§impl WrapBoxBuilder
impl WrapBoxBuilder
sourcepub fn align(self, align: f32) -> Self
pub fn align(self, align: f32) -> Self
The alignment of the children within each line.
0 means the children are placed at the start of the line, 1 means they are placed at the end of the line. 0.5 means they are placed in the middle of the line.
Alignment is only used when justify
is set to
ADW_JUSTIFY_NONE
, or on the last line when the
justify-last-line
is FALSE
.
sourcepub fn child_spacing(self, child_spacing: i32) -> Self
pub fn child_spacing(self, child_spacing: i32) -> Self
The spacing between widgets on the same line.
See child-spacing-unit
.
sourcepub fn child_spacing_unit(self, child_spacing_unit: LengthUnit) -> Self
pub fn child_spacing_unit(self, child_spacing_unit: LengthUnit) -> Self
The length unit for child spacing.
Allows the spacing to vary depending on the text scale factor.
See child-spacing
.
sourcepub fn justify(self, justify: JustifyMode) -> Self
pub fn justify(self, justify: JustifyMode) -> Self
Determines whether and how each complete line should be stretched to fill the entire widget.
If set to ADW_JUSTIFY_FILL
, each widget in the line will be stretched,
keeping consistent spacing, so that the line fills the entire widget.
If set to ADW_JUSTIFY_SPREAD
, the spacing between widgets will be
increased, keeping widget sizes intact. The first and last widget will be
aligned with the beginning and end of the line. If the line only contains
a single widget, it will be stretched regardless.
If set to ADW_JUSTIFY_NONE
, the line will not be stretched and the
children will be placed together within the line, according to
align
.
By default this doesn’t affect the last line, as it will be incomplete. Use
justify-last-line
to justify it as well.
sourcepub fn justify_last_line(self, justify_last_line: bool) -> Self
pub fn justify_last_line(self, justify_last_line: bool) -> Self
Whether the last line should be stretched to fill the entire widget.
See justify
.
sourcepub fn line_homogeneous(self, line_homogeneous: bool) -> Self
pub fn line_homogeneous(self, line_homogeneous: bool) -> Self
Whether all lines should take the same amount of space.
sourcepub fn line_spacing(self, line_spacing: i32) -> Self
pub fn line_spacing(self, line_spacing: i32) -> Self
The spacing between lines.
See line-spacing-unit
.
sourcepub fn line_spacing_unit(self, line_spacing_unit: LengthUnit) -> Self
pub fn line_spacing_unit(self, line_spacing_unit: LengthUnit) -> Self
The length unit for line spacing.
Allows the spacing to vary depending on the text scale factor.
See line-spacing
.
sourcepub fn natural_line_length(self, natural_line_length: i32) -> Self
pub fn natural_line_length(self, natural_line_length: i32) -> Self
Determines the natural size for each line.
It should be used to limit the line lengths, for example when used in popovers.
sourcepub fn natural_line_length_unit(
self,
natural_line_length_unit: LengthUnit,
) -> Self
pub fn natural_line_length_unit( self, natural_line_length_unit: LengthUnit, ) -> Self
The length unit for natural line length.
Allows the length to vary depending on the text scale factor.
See natural-line-length
.
sourcepub fn pack_direction(self, pack_direction: PackDirection) -> Self
pub fn pack_direction(self, pack_direction: PackDirection) -> Self
The direction children are packed in each line.
sourcepub fn wrap_policy(self, wrap_policy: WrapPolicy) -> Self
pub fn wrap_policy(self, wrap_policy: WrapPolicy) -> Self
Whether wrap direction should be reversed.
By default, lines wrap downwards in a horizontal box, and towards the end
in a vertical box. If set to TRUE
, they wrap upwards or towards the start
respectively.
sourcepub fn wrap_reverse(self, wrap_reverse: bool) -> Self
pub fn wrap_reverse(self, wrap_reverse: bool) -> Self
Whether wrap direction should be reversed.
By default, lines wrap downwards in a horizontal box, and towards the end
in a vertical box. If set to TRUE
, they wrap upwards or towards the start
respectively.
sourcepub fn can_focus(self, can_focus: bool) -> Self
pub fn can_focus(self, can_focus: bool) -> Self
Whether the widget or any of its descendents can accept the input focus.
This property is meant to be set by widget implementations, typically in their instance init function.
sourcepub fn can_target(self, can_target: bool) -> Self
pub fn can_target(self, can_target: bool) -> Self
Whether the widget can receive pointer events.
sourcepub fn css_classes(self, css_classes: impl Into<StrV>) -> Self
pub fn css_classes(self, css_classes: impl Into<StrV>) -> Self
A list of css classes applied to this widget.
sourcepub fn css_name(self, css_name: impl Into<GString>) -> Self
pub fn css_name(self, css_name: impl Into<GString>) -> Self
The name of this widget in the CSS tree.
This property is meant to be set by widget implementations, typically in their instance init function.
sourcepub fn focus_on_click(self, focus_on_click: bool) -> Self
pub fn focus_on_click(self, focus_on_click: bool) -> Self
Whether the widget should grab focus when it is clicked with the mouse.
This property is only relevant for widgets that can take focus.
sourcepub fn focusable(self, focusable: bool) -> Self
pub fn focusable(self, focusable: bool) -> Self
Whether this widget itself will accept the input focus.
sourcepub fn halign(self, halign: Align) -> Self
pub fn halign(self, halign: Align) -> Self
How to distribute horizontal space if widget gets extra space.
sourcepub fn has_tooltip(self, has_tooltip: bool) -> Self
pub fn has_tooltip(self, has_tooltip: bool) -> Self
Enables or disables the emission of the ::query-tooltip signal on @widget.
A value of true
indicates that @widget can have a tooltip, in this case
the widget will be queried using query-tooltip
to
determine whether it will provide a tooltip or not.
sourcepub fn height_request(self, height_request: i32) -> Self
pub fn height_request(self, height_request: i32) -> Self
Override for height request of the widget.
If this is -1, the natural request will be used.
sourcepub fn hexpand_set(self, hexpand_set: bool) -> Self
pub fn hexpand_set(self, hexpand_set: bool) -> Self
Whether to use the hexpand
property.
sourcepub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self
pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self
The gtk::LayoutManager
instance to use to compute the preferred size
of the widget, and allocate its children.
This property is meant to be set by widget implementations, typically in their instance init function.
sourcepub fn margin_bottom(self, margin_bottom: i32) -> Self
pub fn margin_bottom(self, margin_bottom: i32) -> Self
Margin on bottom side of widget.
This property adds margin outside of the widget’s normal size
request, the margin will be added in addition to the size from
[WidgetExtManual::set_size_request()
][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
sourcepub fn margin_end(self, margin_end: i32) -> Self
pub fn margin_end(self, margin_end: i32) -> Self
Margin on end of widget, horizontally.
This property supports left-to-right and right-to-left text directions.
This property adds margin outside of the widget’s normal size
request, the margin will be added in addition to the size from
[WidgetExtManual::set_size_request()
][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
sourcepub fn margin_start(self, margin_start: i32) -> Self
pub fn margin_start(self, margin_start: i32) -> Self
Margin on start of widget, horizontally.
This property supports left-to-right and right-to-left text directions.
This property adds margin outside of the widget’s normal size
request, the margin will be added in addition to the size from
[WidgetExtManual::set_size_request()
][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
sourcepub fn margin_top(self, margin_top: i32) -> Self
pub fn margin_top(self, margin_top: i32) -> Self
Margin on top side of widget.
This property adds margin outside of the widget’s normal size
request, the margin will be added in addition to the size from
[WidgetExtManual::set_size_request()
][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
sourcepub fn overflow(self, overflow: Overflow) -> Self
pub fn overflow(self, overflow: Overflow) -> Self
How content outside the widget’s content area is treated.
This property is meant to be set by widget implementations, typically in their instance init function.
sourcepub fn receives_default(self, receives_default: bool) -> Self
pub fn receives_default(self, receives_default: bool) -> Self
Whether the widget will receive the default action when it is focused.
sourcepub fn tooltip_markup(self, tooltip_markup: impl Into<GString>) -> Self
pub fn tooltip_markup(self, tooltip_markup: impl Into<GString>) -> Self
Sets the text of tooltip to be the given string, which is marked up with Pango markup.
Also see Gtk::Tooltip::set_markup()
.
This is a convenience property which will take care of getting the
tooltip shown if the given string is not None
:
has-tooltip
will automatically be set to true
and there will be taken care of query-tooltip
in
the default signal handler.
Note that if both tooltip-text
and
tooltip-markup
are set, the last one wins.
sourcepub fn tooltip_text(self, tooltip_text: impl Into<GString>) -> Self
pub fn tooltip_text(self, tooltip_text: impl Into<GString>) -> Self
Sets the text of tooltip to be the given string.
Also see Gtk::Tooltip::set_text()
.
This is a convenience property which will take care of getting the
tooltip shown if the given string is not None
:
has-tooltip
will automatically be set to true
and there will be taken care of query-tooltip
in
the default signal handler.
Note that if both tooltip-text
and
tooltip-markup
are set, the last one wins.
sourcepub fn valign(self, valign: Align) -> Self
pub fn valign(self, valign: Align) -> Self
How to distribute vertical space if widget gets extra space.
sourcepub fn vexpand_set(self, vexpand_set: bool) -> Self
pub fn vexpand_set(self, vexpand_set: bool) -> Self
Whether to use the vexpand
property.
sourcepub fn width_request(self, width_request: i32) -> Self
pub fn width_request(self, width_request: i32) -> Self
Override for width request of the widget.
If this is -1, the natural request will be used.
sourcepub fn accessible_role(self, accessible_role: AccessibleRole) -> Self
pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self
The accessible role of the given gtk::Accessible
implementation.
The accessible role cannot be changed once set.
sourcepub fn orientation(self, orientation: Orientation) -> Self
pub fn orientation(self, orientation: Orientation) -> Self
The orientation of the orientable.