Skip to main content

ToolbarExt

Trait ToolbarExt 

Source
pub trait ToolbarExt:
    IsA<Toolbar>
    + Sealed
    + 'static {
Show 32 methods // Provided methods fn drop_index(&self, x: i32, y: i32) -> i32 { ... } fn icon_size(&self) -> IconSize { ... } fn item_index(&self, item: &impl IsA<ToolItem>) -> i32 { ... } fn n_items(&self) -> i32 { ... } fn nth_item(&self, n: i32) -> Option<ToolItem> { ... } fn relief_style(&self) -> ReliefStyle { ... } fn shows_arrow(&self) -> bool { ... } fn style(&self) -> ToolbarStyle { ... } fn insert(&self, item: &impl IsA<ToolItem>, pos: i32) { ... } fn set_drop_highlight_item( &self, tool_item: Option<&impl IsA<ToolItem>>, index_: i32, ) { ... } fn set_icon_size(&self, icon_size: IconSize) { ... } fn set_show_arrow(&self, show_arrow: bool) { ... } fn set_style(&self, style: ToolbarStyle) { ... } fn unset_icon_size(&self) { ... } fn unset_style(&self) { ... } fn is_icon_size_set(&self) -> bool { ... } fn set_icon_size_set(&self, icon_size_set: bool) { ... } fn toolbar_style(&self) -> ToolbarStyle { ... } fn set_toolbar_style(&self, toolbar_style: ToolbarStyle) { ... } fn item_expands<T: IsA<Widget>>(&self, item: &T) -> bool { ... } fn set_item_expand<T: IsA<Widget>>(&self, item: &T, expand: bool) { ... } fn item_is_homogeneous<T: IsA<Widget>>(&self, item: &T) -> bool { ... } fn set_item_homogeneous<T: IsA<Widget>>(&self, item: &T, homogeneous: bool) { ... } fn connect_focus_home_or_end<F: Fn(&Self, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn emit_focus_home_or_end(&self, focus_home: bool) -> bool { ... } fn connect_orientation_changed<F: Fn(&Self, Orientation) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_popup_context_menu<F: Fn(&Self, i32, i32, i32) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_style_changed<F: Fn(&Self, ToolbarStyle) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_icon_size_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_icon_size_set_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_show_arrow_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_toolbar_style_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Toolbar methods.

§Implementors

Toolbar

Provided Methods§

Source

fn drop_index(&self, x: i32, y: i32) -> i32

Returns the position corresponding to the indicated point on self. This is useful when dragging items to the toolbar: this function returns the position a new item should be inserted.

x and y are in self coordinates.

§x

x coordinate of a point on the toolbar

§y

y coordinate of a point on the toolbar

§Returns

The position corresponding to the point (x, y) on the toolbar.

Source

fn icon_size(&self) -> IconSize

Retrieves the icon size for the toolbar. See set_icon_size().

§Returns

the current icon size for the icons on the toolbar.

Source

fn item_index(&self, item: &impl IsA<ToolItem>) -> i32

Returns the position of item on the toolbar, starting from 0. It is an error if item is not a child of the toolbar.

§item

a ToolItem that is a child of self

§Returns

the position of item on the toolbar.

Source

fn n_items(&self) -> i32

Returns the number of items on the toolbar.

§Returns

the number of items on the toolbar

Source

fn nth_item(&self, n: i32) -> Option<ToolItem>

Returns the n’th item on self, or None if the toolbar does not contain an n’th item.

§n

A position on the toolbar

§Returns

The n’th ToolItem on self, or None if there isn’t an n’th item.

Source

fn relief_style(&self) -> ReliefStyle

Returns the relief style of buttons on self. See ButtonExt::set_relief().

§Returns

The relief style of buttons on self.

Source

fn shows_arrow(&self) -> bool

Returns whether the toolbar has an overflow menu. See set_show_arrow().

§Returns

true if the toolbar has an overflow menu.

Source

fn style(&self) -> ToolbarStyle

Retrieves whether the toolbar has text, icons, or both . See set_style().

§Returns

the current style of self

Source

fn insert(&self, item: &impl IsA<ToolItem>, pos: i32)

Insert a ToolItem into the toolbar at position pos. If pos is 0 the item is prepended to the start of the toolbar. If pos is negative, the item is appended to the end of the toolbar.

§item

a ToolItem

§pos

the position of the new item

Source

fn set_drop_highlight_item( &self, tool_item: Option<&impl IsA<ToolItem>>, index_: i32, )

Highlights self to give an idea of what it would look like if item was added to self at the position indicated by index_. If item is None, highlighting is turned off. In that case index_ is ignored.

The tool_item passed to this function must not be part of any widget hierarchy. When an item is set as drop highlight item it can not added to any widget hierarchy or used as highlight item for another toolbar.

§tool_item

a ToolItem, or None to turn of highlighting

§index_

a position on self

Source

fn set_icon_size(&self, icon_size: IconSize)

This function sets the size of stock icons in the toolbar. You can call it both before you add the icons and after they’ve been added. The size you set will override user preferences for the default icon size.

This should only be used for special-purpose toolbars, normal application toolbars should respect the user preferences for the size of icons.

§icon_size

The IconSize that stock icons in the toolbar shall have.

Source

fn set_show_arrow(&self, show_arrow: bool)

Sets whether to show an overflow menu when self isn’t allocated enough size to show all of its items. If true, items which can’t fit in self, and which have a proxy menu item set by ToolItemExt::set_proxy_menu_item() or create-menu-proxy, will be available in an overflow menu, which can be opened by an added arrow button. If false, self will request enough size to fit all of its child items without any overflow.

§show_arrow

Whether to show an overflow menu

Source

fn set_style(&self, style: ToolbarStyle)

Alters the view of self to display either icons only, text only, or both.

§style

the new style for self.

Source

fn unset_icon_size(&self)

Unsets toolbar icon size set with set_icon_size(), so that user preferences will be used to determine the icon size.

Source

fn unset_style(&self)

Unsets a toolbar style set with set_style(), so that user preferences will be used to determine the toolbar style.

Source

fn is_icon_size_set(&self) -> bool

Is true if the icon-size property has been set.

Source

fn set_icon_size_set(&self, icon_size_set: bool)

Is true if the icon-size property has been set.

Source

fn toolbar_style(&self) -> ToolbarStyle

Source

fn set_toolbar_style(&self, toolbar_style: ToolbarStyle)

Source

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

Source

fn set_item_expand<T: IsA<Widget>>(&self, item: &T, expand: bool)

Source

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

Source

fn set_item_homogeneous<T: IsA<Widget>>(&self, item: &T, homogeneous: bool)

Source

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

A keybinding signal used internally by GTK+. This signal can’t be used in application code

§focus_home

true if the first item should be focused

§Returns

true if the signal was handled, false if not

Source

fn emit_focus_home_or_end(&self, focus_home: bool) -> bool

Source

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

Emitted when the orientation of the toolbar changes.

§orientation

the new Orientation of the toolbar

Source

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

Emitted when the user right-clicks the toolbar or uses the keybinding to display a popup menu.

Application developers should handle this signal if they want to display a context menu on the toolbar. The context-menu should appear at the coordinates given by x and y. The mouse button number is given by the button parameter. If the menu was popped up using the keybaord, button is -1.

§x

the x coordinate of the point where the menu should appear

§y

the y coordinate of the point where the menu should appear

§button

the mouse button the user pressed, or -1

§Returns

return true if the signal was handled, false if not

Source

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

Emitted when the style of the toolbar changes.

§style

the new ToolbarStyle of the toolbar

Source

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

Source

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

Source

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

Source

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