[][src]Trait gtk::ToolItemExt

pub trait ToolItemExt: 'static {
    fn get_ellipsize_mode(&self) -> EllipsizeMode;
fn get_expand(&self) -> bool;
fn get_homogeneous(&self) -> bool;
fn get_icon_size(&self) -> IconSize;
fn get_is_important(&self) -> bool;
fn get_orientation(&self) -> Orientation;
fn get_proxy_menu_item(&self, menu_item_id: &str) -> Option<Widget>;
fn get_relief_style(&self) -> ReliefStyle;
fn get_text_alignment(&self) -> f32;
fn get_text_orientation(&self) -> Orientation;
fn get_text_size_group(&self) -> Option<SizeGroup>;
fn get_toolbar_style(&self) -> ToolbarStyle;
fn get_use_drag_window(&self) -> bool;
fn get_visible_horizontal(&self) -> bool;
fn get_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_property_is_important_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_visible_horizontal_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_visible_vertical_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all ToolItem methods.

Implementors

SeparatorToolItem, ToolButton, ToolItem

Required methods

fn get_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.

fn get_expand(&self) -> bool

Returns whether self is allocated extra space. See ToolItemExt::set_expand.

Returns

true if self is allocated extra space.

fn get_homogeneous(&self) -> bool

Returns whether self is the same size as other homogeneous items. See ToolItemExt::set_homogeneous.

Returns

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

fn get_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

fn get_is_important(&self) -> bool

Returns whether self is considered important. See ToolItemExt::set_is_important

Returns

true if self is considered important.

fn get_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

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

If menu_item_id matches the string passed to ToolItemExt::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 ToolItemExt::set_proxy_menu_item, if the menu_item_ids match.

fn get_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 ToolItem::toolbar_reconfigured signal to find out the relief style of buttons.

Returns

a ReliefStyle indicating the relief style used for self.

fn get_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

fn get_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

fn get_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

fn get_toolbar_style(&self) -> ToolbarStyle

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

Possibilities are:

  • ToolbarStyle::Both, meaning the tool item should show both an icon and a label, stacked vertically
  • ToolbarStyle::Icons, meaning the toolbar shows only icons
  • ToolbarStyle::Text, meaning the tool item should only show text
  • ToolbarStyle::BothHoriz, meaning the tool item should show both an icon and a label, arranged horizontally

Returns

A ToolbarStyle indicating the toolbar style used for self.

fn get_use_drag_window(&self) -> bool

Returns whether self has a drag window. See ToolItemExt::set_use_drag_window.

Returns

true if self uses a drag window.

fn get_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.

fn get_visible_vertical(&self) -> bool

Returns whether self is visible when the toolbar is docked vertically. See ToolItemExt::set_visible_vertical.

Returns

Whether self is visible when the toolbar is docked vertically

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

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

Returns the MenuItem that was last set by ToolItemExt::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.

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

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

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

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

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 ToolItemExt::get_proxy_menu_item.

See also ToolItem::create-menu-proxy.

a string used to identify menu_item

a MenuItem to use in the overflow menu, or None

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 Widget::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.

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

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

fn toolbar_reconfigured(&self)

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

fn connect_create_menu_proxy<F: Fn(&Self) -> Inhibit + '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 ToolItemExt::set_proxy_menu_item with a None pointer and return true to indicate that the item should not appear in the overflow menu

  • call ToolItemExt::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 ToolItemExt::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

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

  • ToolShell::get_orientation
  • ToolShell::get_style
  • ToolShell::get_icon_size
  • ToolShell::get_relief_style to find out what the toolbar should look like and change themselves accordingly.

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

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

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

Loading content...

Implementors

impl<O: IsA<ToolItem>> ToolItemExt for O[src]

Loading content...