Skip to main content

ToolItemExt

Trait ToolItemExt 

Source
pub trait ToolItemExt:
    IsA<ToolItem>
    + Sealed
    + 'static {
Show 32 methods // Provided methods fn ellipsize_mode(&self) -> EllipsizeMode { ... } fn expands(&self) -> bool { ... } fn is_homogeneous(&self) -> bool { ... } fn icon_size(&self) -> IconSize { ... } fn is_important(&self) -> bool { ... } fn orientation(&self) -> Orientation { ... } fn proxy_menu_item(&self, menu_item_id: &str) -> Option<Widget> { ... } fn relief_style(&self) -> ReliefStyle { ... } fn text_alignment(&self) -> f32 { ... } fn text_orientation(&self) -> Orientation { ... } fn text_size_group(&self) -> Option<SizeGroup> { ... } fn toolbar_style(&self) -> ToolbarStyle { ... } fn uses_drag_window(&self) -> bool { ... } fn is_visible_horizontal(&self) -> bool { ... } fn is_visible_vertical(&self) -> bool { ... } fn rebuild_menu(&self) { ... } fn retrieve_proxy_menu_item(&self) -> Option<Widget> { ... } fn set_expand(&self, expand: bool) { ... } fn set_homogeneous(&self, homogeneous: bool) { ... } fn set_is_important(&self, is_important: bool) { ... } fn set_proxy_menu_item( &self, menu_item_id: &str, menu_item: Option<&impl IsA<Widget>>, ) { ... } fn set_tooltip_markup(&self, markup: &str) { ... } fn set_tooltip_text(&self, text: &str) { ... } fn set_use_drag_window(&self, use_drag_window: bool) { ... } fn set_visible_horizontal(&self, visible_horizontal: bool) { ... } fn set_visible_vertical(&self, visible_vertical: bool) { ... } fn toolbar_reconfigured(&self) { ... } fn connect_create_menu_proxy<F: Fn(&Self) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_toolbar_reconfigured<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_is_important_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_visible_horizontal_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_visible_vertical_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all ToolItem methods.

§Implementors

SeparatorToolItem, ToolButton, ToolItem

Provided Methods§

Source

fn ellipsize_mode(&self) -> EllipsizeMode

Returns the ellipsize mode used for self. Custom subclasses of ToolItem should call this function to find out how text should be ellipsized.

§Returns

a pango::EllipsizeMode indicating how text in self should be ellipsized.

Source

fn expands(&self) -> bool

Returns whether self is allocated extra space. See set_expand().

§Returns

true if self is allocated extra space.

Source

fn is_homogeneous(&self) -> bool

Returns whether self is the same size as other homogeneous items. See set_homogeneous().

§Returns

true if the item is the same size as other homogeneous items.

Source

fn icon_size(&self) -> IconSize

Returns the icon size used for self. Custom subclasses of ToolItem should call this function to find out what size icons they should use.

§Returns

a IconSize indicating the icon size used for self

Source

fn is_important(&self) -> bool

Returns whether self is considered important. See set_is_important()

§Returns

true if self is considered important.

Source

fn orientation(&self) -> Orientation

Returns the orientation used for self. Custom subclasses of ToolItem should call this function to find out what size icons they should use.

§Returns

a Orientation indicating the orientation used for self

Source

fn proxy_menu_item(&self, menu_item_id: &str) -> Option<Widget>

If menu_item_id matches the string passed to set_proxy_menu_item() return the corresponding MenuItem.

Custom subclasses of ToolItem should use this function to update their menu item when the ToolItem changes. That the menu_item_ids must match ensures that a ToolItem will not inadvertently change a menu item that they did not create.

a string used to identify the menu item

§Returns

The MenuItem passed to set_proxy_menu_item(), if the menu_item_ids match.

Source

fn relief_style(&self) -> ReliefStyle

Returns the relief style of self. See ButtonExt::set_relief(). Custom subclasses of ToolItem should call this function in the handler of the toolbar_reconfigured signal to find out the relief style of buttons.

§Returns

a ReliefStyle indicating the relief style used for self.

Source

fn text_alignment(&self) -> f32

Returns the text alignment used for self. Custom subclasses of ToolItem should call this function to find out how text should be aligned.

§Returns

a gfloat indicating the horizontal text alignment used for self

Source

fn text_orientation(&self) -> Orientation

Returns the text orientation used for self. Custom subclasses of ToolItem should call this function to find out how text should be orientated.

§Returns

a Orientation indicating the text orientation used for self

Source

fn text_size_group(&self) -> Option<SizeGroup>

Returns the size group used for labels in self. Custom subclasses of ToolItem should call this function and use the size group for labels.

§Returns

a SizeGroup

Source

fn toolbar_style(&self) -> ToolbarStyle

Returns the toolbar style used for self. Custom subclasses of ToolItem should call this function in the handler of the GtkToolItem::toolbar_reconfigured signal to find out in what style the toolbar is displayed and change themselves accordingly

Possibilities are:

§Returns

A ToolbarStyle indicating the toolbar style used for self.

Source

fn uses_drag_window(&self) -> bool

Returns whether self has a drag window. See set_use_drag_window().

§Returns

true if self uses a drag window.

Source

fn is_visible_horizontal(&self) -> bool

Returns whether the self is visible on toolbars that are docked horizontally.

§Returns

true if self is visible on toolbars that are docked horizontally.

Source

fn is_visible_vertical(&self) -> bool

Returns whether self is visible when the toolbar is docked vertically. See set_visible_vertical().

§Returns

Whether self is visible when the toolbar is docked vertically

Source

fn rebuild_menu(&self)

Calling this function signals to the toolbar that the overflow menu item for self has changed. If the overflow menu is visible when this function it called, the menu will be rebuilt.

The function must be called when the tool item changes what it will do in response to the create-menu-proxy signal.

Source

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

Returns the MenuItem that was last set by set_proxy_menu_item(), ie. the MenuItem that is going to appear in the overflow menu.

§Returns

The MenuItem that is going to appear in the overflow menu for self.

Source

fn set_expand(&self, expand: bool)

Sets whether self is allocated extra space when there is more room on the toolbar then needed for the items. The effect is that the item gets bigger when the toolbar gets bigger and smaller when the toolbar gets smaller.

§expand

Whether self is allocated extra space

Source

fn set_homogeneous(&self, homogeneous: bool)

Sets whether self is to be allocated the same size as other homogeneous items. The effect is that all homogeneous items will have the same width as the widest of the items.

§homogeneous

whether self is the same size as other homogeneous items

Source

fn set_is_important(&self, is_important: bool)

Sets whether self should be considered important. The ToolButton class uses this property to determine whether to show or hide its label when the toolbar style is ToolbarStyle::BothHoriz. The result is that only tool buttons with the “is_important” property set have labels, an effect known as “priority text”

§is_important

whether the tool item should be considered important

Source

fn set_proxy_menu_item( &self, menu_item_id: &str, menu_item: Option<&impl IsA<Widget>>, )

Sets the MenuItem used in the toolbar overflow menu. The menu_item_id is used to identify the caller of this function and should also be used with proxy_menu_item().

See also create-menu-proxy.

a string used to identify menu_item

a MenuItem to use in the overflow menu, or None

Source

fn set_tooltip_markup(&self, markup: &str)

Sets the markup text to be displayed as tooltip on the item. See WidgetExt::set_tooltip_markup().

§markup

markup text to be used as tooltip for self

Source

fn set_tooltip_text(&self, text: &str)

Sets the text to be displayed as tooltip on the item. See WidgetExt::set_tooltip_text().

§text

text to be used as tooltip for self

Source

fn set_use_drag_window(&self, use_drag_window: bool)

Sets whether self has a drag window. When true the toolitem can be used as a drag source through WidgetExtManual::drag_source_set(). When self has a drag window it will intercept all events, even those that would otherwise be sent to a child of self.

§use_drag_window

Whether self has a drag window.

Source

fn set_visible_horizontal(&self, visible_horizontal: bool)

Sets whether self is visible when the toolbar is docked horizontally.

§visible_horizontal

Whether self is visible when in horizontal mode

Source

fn set_visible_vertical(&self, visible_vertical: bool)

Sets whether self is visible when the toolbar is docked vertically. Some tool items, such as text entries, are too wide to be useful on a vertically docked toolbar. If visible_vertical is false self will not appear on toolbars that are docked vertically.

§visible_vertical

whether self is visible when the toolbar is in vertical mode

Source

fn toolbar_reconfigured(&self)

Emits the signal toolbar_reconfigured on self. Toolbar and other ToolShell implementations use this function to notify children, when some aspect of their configuration changes.

Source

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

This signal is emitted when the toolbar needs information from tool_item about whether the item should appear in the toolbar overflow menu. In response the tool item should either

  • call set_proxy_menu_item() with a None pointer and return true to indicate that the item should not appear in the overflow menu

  • call set_proxy_menu_item() with a new menu item and return true, or

  • return false to indicate that the signal was not handled by the item. This means that the item will not appear in the overflow menu unless a later handler installs a menu item.

The toolbar may cache the result of this signal. When the tool item changes how it will respond to this signal it must call rebuild_menu() to invalidate the cache and ensure that the toolbar rebuilds its overflow menu.

§Returns

true if the signal was handled, false if not

Source

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

This signal is emitted when some property of the toolbar that the item is a child of changes. For custom subclasses of ToolItem, the default handler of this signal use the functions

Source

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

Source

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

Source

fn connect_visible_vertical_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§