[−][src]Trait gtk::prelude::ToolbarExt
Required methods
fn get_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.
fn get_item_index<P: IsA<ToolItem>>(&self, item: &P) -> 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.
fn get_n_items(&self) -> i32
fn get_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.
fn get_show_arrow(&self) -> bool
Returns whether the toolbar has an overflow menu.
See ToolbarExt::set_show_arrow
.
Returns
true
if the toolbar has an overflow menu.
fn insert<P: IsA<ToolItem>>(&self, item: &P, 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
fn set_drop_highlight_item<P: IsA<ToolItem>>(
&self,
tool_item: Option<&P>,
index_: i32
)
&self,
tool_item: Option<&P>,
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
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.
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 ToolItem::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
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
.
fn unset_icon_size(&self)
Unsets toolbar icon size set with ToolbarExt::set_icon_size
, so that
user preferences will be used to determine the icon size.
fn unset_style(&self)
Unsets a toolbar style set with ToolbarExt::set_style
, so that
user preferences will be used to determine the toolbar style.
fn get_property_icon_size_set(&self) -> bool
Is true
if the icon-size property has been set.
fn set_property_icon_size_set(&self, icon_size_set: bool)
Is true
if the icon-size property has been set.
fn get_property_toolbar_style(&self) -> ToolbarStyle
fn set_property_toolbar_style(&self, toolbar_style: ToolbarStyle)
fn get_item_expand<T: IsA<Widget>>(&self, item: &T) -> bool
fn set_item_expand<T: IsA<Widget>>(&self, item: &T, expand: bool)
fn get_item_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
&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
fn emit_focus_home_or_end(&self, focus_home: bool) -> bool
fn connect_orientation_changed<F: Fn(&Self, Orientation) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_popup_context_menu<F: Fn(&Self, i32, i32, i32) -> Inhibit + 'static>(
&self,
f: F
) -> SignalHandlerId
&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
fn connect_style_changed<F: Fn(&Self, ToolbarStyle) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_icon_size_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_icon_size_set_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_show_arrow_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_toolbar_style_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
Implementors
impl<O: IsA<Toolbar>> ToolbarExt for O
[src]
fn get_drop_index(&self, x: i32, y: i32) -> i32
[src]
fn get_item_index<P: IsA<ToolItem>>(&self, item: &P) -> i32
[src]
fn get_n_items(&self) -> i32
[src]
fn get_nth_item(&self, n: i32) -> Option<ToolItem>
[src]
fn get_show_arrow(&self) -> bool
[src]
fn insert<P: IsA<ToolItem>>(&self, item: &P, pos: i32)
[src]
fn set_drop_highlight_item<P: IsA<ToolItem>>(
&self,
tool_item: Option<&P>,
index_: i32
)
[src]
&self,
tool_item: Option<&P>,
index_: i32
)
fn set_icon_size(&self, icon_size: IconSize)
[src]
fn set_show_arrow(&self, show_arrow: bool)
[src]
fn set_style(&self, style: ToolbarStyle)
[src]
fn unset_icon_size(&self)
[src]
fn unset_style(&self)
[src]
fn get_property_icon_size_set(&self) -> bool
[src]
fn set_property_icon_size_set(&self, icon_size_set: bool)
[src]
fn get_property_toolbar_style(&self) -> ToolbarStyle
[src]
fn set_property_toolbar_style(&self, toolbar_style: ToolbarStyle)
[src]
fn get_item_expand<T: IsA<Widget>>(&self, item: &T) -> bool
[src]
fn set_item_expand<T: IsA<Widget>>(&self, item: &T, expand: bool)
[src]
fn get_item_homogeneous<T: IsA<Widget>>(&self, item: &T) -> bool
[src]
fn set_item_homogeneous<T: IsA<Widget>>(&self, item: &T, homogeneous: bool)
[src]
fn connect_focus_home_or_end<F: Fn(&Self, bool) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn emit_focus_home_or_end(&self, focus_home: bool) -> bool
[src]
fn connect_orientation_changed<F: Fn(&Self, Orientation) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_popup_context_menu<F: Fn(&Self, i32, i32, i32) -> Inhibit + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_style_changed<F: Fn(&Self, ToolbarStyle) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_icon_size_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_icon_size_set_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_show_arrow_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_toolbar_style_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId