Trait gtk::prelude::ToolItemExt[][src]

pub trait ToolItemExt: 'static {
Show 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<P: IsA<Widget>>(
        &self,
        menu_item_id: &str,
        menu_item: Option<&P>
    );
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) -> Inhibit + '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

Required methods

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.

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

Returns

true if self is allocated extra space.

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.

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

Returns whether self is considered important. See set_is_important()

Returns

true if self is considered important.

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

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.

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

Returns

a ReliefStyle indicating the relief style used for self.

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

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

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

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.

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

Returns

true if self uses a drag window.

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

Returns

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

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

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 signal::ToolItem::create-menu-proxy signal.

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.

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

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

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

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 signal::ToolItem::create-menu-proxy.

a string used to identify menu_item

a MenuItem to use in the overflow menu, or None

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.

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

visible_horizontal

Whether self is visible when in horizontal mode

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

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

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

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

Implementors