Trait gtk::prelude::ToolbarExt
source · [−]pub trait ToolbarExt: 'static {
Show 29 methods
fn drop_index(&self, x: i32, y: i32) -> i32;
fn item_index(&self, item: &impl IsA<ToolItem>) -> i32;
fn n_items(&self) -> i32;
fn nth_item(&self, n: i32) -> Option<ToolItem>;
fn shows_arrow(&self) -> bool;
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) -> Inhibit + '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
Required Methods
fn drop_index(&self, x: i32, y: i32) -> i32
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.
fn item_index(&self, item: &impl IsA<ToolItem>) -> i32
fn item_index(&self, item: &impl IsA<ToolItem>) -> i32
fn shows_arrow(&self) -> bool
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.
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)
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)
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 signal::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)
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)
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.
fn unset_style(&self)
fn unset_style(&self)
Unsets a toolbar style set with set_style()
, so that
user preferences will be used to determine the toolbar style.
fn is_icon_size_set(&self) -> bool
fn is_icon_size_set(&self) -> bool
Is true
if the icon-size property has been set.
fn set_icon_size_set(&self, icon_size_set: bool)
fn set_icon_size_set(&self, icon_size_set: bool)
Is true
if the icon-size property has been set.
fn toolbar_style(&self) -> ToolbarStyle
fn set_toolbar_style(&self, toolbar_style: ToolbarStyle)
fn connect_focus_home_or_end<F: Fn(&Self, bool) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId
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
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_orientation_changed<F: Fn(&Self, Orientation) + '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