Toolbar

../_images/toolbar-preview.png

Widget description

A toolbar is a widget that displays a list of items inside a box. It can be scrollable, show a menu with items that don’t fit to toolbar size or even crop them.

Only one item can be selected at a time.

Items can have multiple states, or show menus when selected by the user.

Emitted signals

  • clicked - when the user clicks on a toolbar item and becomes selected.

  • longpressed - when the toolbar is pressed for a certain amount of time.

  • item,focused - When the toolbar item has received focus. (since 1.10)

  • item,unfocused - When the toolbar item has lost focus. (since 1.10)

Available styles

  • default

  • transparent - no background or shadow, just show the content

Layout text parts

  • default - label of the toolbar item

Scrollable Interface

This widget supports the scrollable interface.

If you wish to control the scrolling behaviour using these functions, inherit both the widget class and the Scrollable class using multiple inheritance, for example:

class ScrollableGenlist(Genlist, Scrollable):
    def __init__(self, canvas, *args, **kwargs):
        Genlist.__init__(self, canvas)

Enumerations

Toolbar shrink modes

efl.elementary.ELM_TOOLBAR_SHRINK_NONE

Set toolbar minimum size to fit all the items

efl.elementary.ELM_TOOLBAR_SHRINK_HIDE

Hide exceeding items

efl.elementary.ELM_TOOLBAR_SHRINK_SCROLL

Allow accessing exceeding items through a scroller

efl.elementary.ELM_TOOLBAR_SHRINK_MENU

Inserts a button to pop up a menu with exceeding items

efl.elementary.ELM_TOOLBAR_SHRINK_EXPAND

Expand all items according the size of the toolbar.

Toolbar item scrollto types

Where to position the item in the toolbar.

efl.elementary.ELM_TOOLBAR_ITEM_SCROLLTO_NONE

No scrollto

efl.elementary.ELM_TOOLBAR_ITEM_SCROLLTO_IN

To the nearest viewport

efl.elementary.ELM_TOOLBAR_ITEM_SCROLLTO_FIRST

To the first of viewport

efl.elementary.ELM_TOOLBAR_ITEM_SCROLLTO_MIDDLE

To the middle of viewport

efl.elementary.ELM_TOOLBAR_ITEM_SCROLLTO_LAST

To the last of viewport

Inheritance diagram

class efl.elementary.Toolbar(Object parent, *args, **kwargs)

Changed in version 1.8: Inherits from LayoutClass.

Parameters
  • parent (efl.evas.Object) – The parent object

  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance

class efl.elementary.ToolbarItem(icon=None, label=None, callback=None, cb_data=None, *args, **kwargs)

this item is selected, i.e., the user clicks over an unselected item. If such function isn’t needed, just passing None as func is enough. The same should be done for data.

Toolbar will load icon image from fdo or current theme. This behavior can be set by Toolbar.icon_order_lookup function. If an absolute path is provided it will load it direct from a file.

Parameters
  • icon (string) – A string with icon name or the absolute path of an image file.

  • label (string) – The label of the item.

  • callback (function) – The function to call when the item is clicked.

class efl.elementary.ToolbarItemState(ToolbarItem it, icon=None, label=None, callback=None, *args, **kwargs)