Skip to main content

StackExt

Trait StackExt 

Source
pub trait StackExt:
    IsA<Stack>
    + Sealed
    + 'static {
Show 40 methods // Provided 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

Trait containing all Stack methods.

§Implementors

Stack

Provided Methods§

Source

fn add_named(&self, child: &impl IsA<Widget>, name: &str)

Adds a child to self. The child is identified by the name.

§child

the widget to add

§name

the name for child

Source

fn add_titled(&self, child: &impl IsA<Widget>, name: &str, title: &str)

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

Source

fn child_by_name(&self, name: &str) -> Option<Widget>

Finds the child of the Stack with the name given as the argument. Returns None if there is no child with this name.

§name

the name of the child to find

§Returns

the requested child of the Stack

Source

fn is_hhomogeneous(&self) -> bool

Gets whether self is horizontally homogeneous. See set_hhomogeneous().

§Returns

whether self is horizontally homogeneous.

Source

fn is_homogeneous(&self) -> bool

Gets whether self is homogeneous. See set_homogeneous().

§Returns

whether self is homogeneous.

Source

fn interpolates_size(&self) -> bool

Returns wether the Stack is set up to interpolate between the sizes of children on page switch.

§Returns

true if child sizes are interpolated

Source

fn transition_duration(&self) -> u32

Returns the amount of time (in milliseconds) that transitions between pages in self will take.

§Returns

the transition duration

Source

fn is_transition_running(&self) -> bool

Returns whether the self is currently in a transition from one page to another.

§Returns

true if the transition is currently running, false otherwise.

Source

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

Source

fn is_vhomogeneous(&self) -> bool

Gets whether self is vertically homogeneous. See set_vhomogeneous().

§Returns

whether self is vertically homogeneous.

Source

fn visible_child(&self) -> Option<Widget>

Gets the currently visible child of self, or None if there are no visible children.

§Returns

the visible child of the Stack

Source

fn visible_child_name(&self) -> Option<GString>

Returns the name of the currently visible child of self, or None if there is no visible child.

§Returns

the name of the visible child of the Stack

Source

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

Source

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 hhomogeneous and vhomogeneous.

§homogeneous

true to make self homogeneous

Source

fn set_interpolate_size(&self, interpolate_size: bool)

Sets whether or not self will interpolate its size when changing the visible child. If the 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

Source

fn set_transition_duration(&self, duration: u32)

Sets the duration that transitions between pages in self will take.

§duration

the new duration, in milliseconds

Source

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

Source

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

Source

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

Source

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

Source

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

Source

fn child_icon_name<T: IsA<Widget>>(&self, item: &T) -> Option<GString>

Source

fn set_child_icon_name<T: IsA<Widget>>(&self, item: &T, icon_name: Option<&str>)

Source

fn child_name<T: IsA<Widget>>(&self, item: &T) -> Option<GString>

Source

fn set_child_name<T: IsA<Widget>>(&self, item: &T, name: Option<&str>)

Source

fn child_needs_attention<T: IsA<Widget>>(&self, item: &T) -> bool

Source

fn set_child_needs_attention<T: IsA<Widget>>( &self, item: &T, needs_attention: bool, )

Source

fn child_position<T: IsA<Widget>>(&self, item: &T) -> i32

Source

fn set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32)

Source

fn child_title<T: IsA<Widget>>(&self, item: &T) -> Option<GString>

Source

fn set_child_title<T: IsA<Widget>>(&self, item: &T, title: Option<&str>)

Source

fn connect_hhomogeneous_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_homogeneous_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_interpolate_size_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_transition_duration_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_transition_running_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_transition_type_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_vhomogeneous_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_visible_child_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_visible_child_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<O: IsA<Stack>> StackExt for O