pub trait StackExt: 'static {
Show 40 methods
fn add_named(&self, child: &impl IsA<Widget>, name: &str);
fn add_titled(&self, child: &impl IsA<Widget>, name: &str, title: &str);
fn child_by_name(&self, name: &str) -> Option<Widget>;
fn is_hhomogeneous(&self) -> bool;
fn is_homogeneous(&self) -> bool;
fn interpolates_size(&self) -> bool;
fn transition_duration(&self) -> u32;
fn is_transition_running(&self) -> bool;
fn transition_type(&self) -> StackTransitionType;
fn is_vhomogeneous(&self) -> bool;
fn visible_child(&self) -> Option<Widget>;
fn visible_child_name(&self) -> Option<GString>;
fn set_hhomogeneous(&self, hhomogeneous: bool);
fn set_homogeneous(&self, homogeneous: bool);
fn set_interpolate_size(&self, interpolate_size: bool);
fn set_transition_duration(&self, duration: u32);
fn set_transition_type(&self, transition: StackTransitionType);
fn set_vhomogeneous(&self, vhomogeneous: bool);
fn set_visible_child(&self, child: &impl IsA<Widget>);
fn set_visible_child_full(
&self,
name: &str,
transition: StackTransitionType
);
fn set_visible_child_name(&self, name: &str);
fn child_icon_name<T: IsA<Widget>>(&self, item: &T) -> Option<GString>;
fn set_child_icon_name<T: IsA<Widget>>(
&self,
item: &T,
icon_name: Option<&str>
);
fn child_name<T: IsA<Widget>>(&self, item: &T) -> Option<GString>;
fn set_child_name<T: IsA<Widget>>(&self, item: &T, name: Option<&str>);
fn child_needs_attention<T: IsA<Widget>>(&self, item: &T) -> bool;
fn set_child_needs_attention<T: IsA<Widget>>(
&self,
item: &T,
needs_attention: bool
);
fn child_position<T: IsA<Widget>>(&self, item: &T) -> i32;
fn set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32);
fn child_title<T: IsA<Widget>>(&self, item: &T) -> Option<GString>;
fn set_child_title<T: IsA<Widget>>(&self, item: &T, title: Option<&str>);
fn connect_hhomogeneous_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_homogeneous_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_interpolate_size_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_transition_duration_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_transition_running_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_transition_type_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_vhomogeneous_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_visible_child_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_visible_child_name_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
}
Expand description
Required Methods
Adds a child to self
.
The child is identified by the name
. The title
will be used by StackSwitcher
to represent
child
in a tab bar, so it should be short.
child
the widget to add
name
the name for child
title
a human-readable title for child
fn child_by_name(&self, name: &str) -> Option<Widget>
fn child_by_name(&self, name: &str) -> Option<Widget>
fn is_hhomogeneous(&self) -> bool
fn is_hhomogeneous(&self) -> bool
Gets whether self
is horizontally homogeneous.
See set_hhomogeneous()
.
Returns
whether self
is horizontally homogeneous.
fn is_homogeneous(&self) -> bool
fn is_homogeneous(&self) -> bool
fn interpolates_size(&self) -> bool
fn interpolates_size(&self) -> bool
fn transition_duration(&self) -> u32
fn transition_duration(&self) -> u32
Returns the amount of time (in milliseconds) that
transitions between pages in self
will take.
Returns
the transition duration
fn is_transition_running(&self) -> bool
fn is_transition_running(&self) -> bool
fn transition_type(&self) -> StackTransitionType
fn transition_type(&self) -> StackTransitionType
Gets the type of animation that will be used
for transitions between pages in self
.
Returns
the current transition type of self
fn is_vhomogeneous(&self) -> bool
fn is_vhomogeneous(&self) -> bool
Gets whether self
is vertically homogeneous.
See set_vhomogeneous()
.
Returns
whether self
is vertically homogeneous.
fn visible_child(&self) -> Option<Widget>
fn visible_child(&self) -> Option<Widget>
fn visible_child_name(&self) -> Option<GString>
fn visible_child_name(&self) -> Option<GString>
fn set_hhomogeneous(&self, hhomogeneous: bool)
fn set_hhomogeneous(&self, hhomogeneous: bool)
Sets the Stack
to be horizontally homogeneous or not.
If it is homogeneous, the Stack
will request the same
width for all its children. If it isn’t, the stack
may change width when a different child becomes visible.
hhomogeneous
true
to make self
horizontally homogeneous
fn set_homogeneous(&self, homogeneous: bool)
fn set_homogeneous(&self, homogeneous: bool)
Sets the Stack
to be homogeneous or not. If it
is homogeneous, the Stack
will request the same
size for all its children. If it isn’t, the stack
may change size when a different child becomes visible.
Since 3.16, homogeneity can be controlled separately
for horizontal and vertical size, with the
property::Stack::hhomogeneous
and property::Stack::vhomogeneous
.
homogeneous
true
to make self
homogeneous
fn set_interpolate_size(&self, interpolate_size: bool)
fn set_interpolate_size(&self, interpolate_size: bool)
Sets whether or not self
will interpolate its size when
changing the visible child. If the property::Stack::interpolate-size
property is set to true
, self
will interpolate its size between
the current one and the one it’ll take after changing the
visible child, according to the set transition duration.
interpolate_size
the new value
fn set_transition_duration(&self, duration: u32)
fn set_transition_duration(&self, duration: u32)
Sets the duration that transitions between pages in self
will take.
duration
the new duration, in milliseconds
fn set_transition_type(&self, transition: StackTransitionType)
fn set_transition_type(&self, transition: StackTransitionType)
Sets the type of animation that will be used for
transitions between pages in self
. Available
types include various kinds of fades and slides.
The transition type can be changed without problems at runtime, so it is possible to change the animation based on the page that is about to become current.
transition
the new transition type
fn set_vhomogeneous(&self, vhomogeneous: bool)
fn set_vhomogeneous(&self, vhomogeneous: bool)
Sets the Stack
to be vertically homogeneous or not.
If it is homogeneous, the Stack
will request the same
height for all its children. If it isn’t, the stack
may change height when a different child becomes visible.
vhomogeneous
true
to make self
vertically homogeneous
fn set_visible_child(&self, child: &impl IsA<Widget>)
fn set_visible_child(&self, child: &impl IsA<Widget>)
Makes child
the visible child of self
.
If child
is different from the currently
visible child, the transition between the
two will be animated with the current
transition type of self
.
Note that the child
widget has to be visible itself
(see WidgetExt::show()
) in order to become the visible
child of self
.
child
a child of self
fn set_visible_child_full(&self, name: &str, transition: StackTransitionType)
fn set_visible_child_full(&self, name: &str, transition: StackTransitionType)
Makes the child with the given name visible.
Note that the child widget has to be visible itself
(see WidgetExt::show()
) in order to become the visible
child of self
.
name
the name of the child to make visible
transition
the transition type to use
fn set_visible_child_name(&self, name: &str)
fn set_visible_child_name(&self, name: &str)
Makes the child with the given name visible.
If child
is different from the currently
visible child, the transition between the
two will be animated with the current
transition type of self
.
Note that the child widget has to be visible itself
(see WidgetExt::show()
) in order to become the visible
child of self
.
name
the name of the child to make visible