aqt.toolbar
===========

.. py:module:: aqt.toolbar


Classes
-------

.. autoapisummary::

   aqt.toolbar.HideMode
   aqt.toolbar.TopToolbar
   aqt.toolbar.BottomToolbar
   aqt.toolbar.ToolbarWebView
   aqt.toolbar.TopWebView
   aqt.toolbar.BottomWebView
   aqt.toolbar.Toolbar
   aqt.toolbar.BottomBar


Module Contents
---------------

.. py:class:: HideMode

   Bases: :py:obj:`enum.IntEnum`


   Enum where members are also (and must be) ints


   .. py:attribute:: FULLSCREEN
      :value: 0



   .. py:attribute:: ALWAYS
      :value: 1



.. py:class:: TopToolbar(toolbar: Toolbar)

   .. py:attribute:: toolbar


.. py:class:: BottomToolbar(toolbar: Toolbar)

   .. py:attribute:: toolbar


.. py:class:: ToolbarWebView(mw: aqt.AnkiQt, kind: aqt.webview.AnkiWebViewKind = AnkiWebViewKind.DEFAULT)

   Bases: :py:obj:`aqt.webview.AnkiWebView`


   .. py:attribute:: hide_condition
      :type:  collections.abc.Callable[Ellipsis, bool]


   .. py:attribute:: mw


   .. py:attribute:: hidden
      :value: False



   .. py:attribute:: hide_timer


   .. py:method:: reset_timer() -> None


   .. py:method:: hide() -> None


   .. py:method:: show() -> None


.. py:class:: TopWebView(mw: aqt.AnkiQt)

   Bases: :py:obj:`ToolbarWebView`


   .. py:attribute:: web_height
      :value: 0



   .. py:method:: eventFilter(obj, evt)


   .. py:method:: on_body_classes_need_update() -> None


   .. py:method:: hide_if_allowed() -> None


   .. py:method:: hide() -> None


   .. py:method:: show() -> None


   .. py:method:: flatten() -> None


   .. py:method:: elevate() -> None


   .. py:method:: update_background_image() -> None


   .. py:method:: set_body_height(height: int) -> None


   .. py:method:: adjustHeightToFit() -> None


   .. py:method:: resizeEvent(event: QResizeEvent | None) -> None


.. py:class:: BottomWebView(mw: aqt.AnkiQt)

   Bases: :py:obj:`ToolbarWebView`


   .. py:method:: eventFilter(obj, evt)


   .. py:method:: on_body_classes_need_update() -> None


   .. py:method:: animate_height(height: int) -> None


   .. py:method:: hide_if_allowed() -> None


   .. py:method:: hide() -> None


   .. py:method:: show() -> None


.. py:class:: Toolbar(mw: aqt.AnkiQt, web: aqt.webview.AnkiWebView)

   .. py:attribute:: mw


   .. py:attribute:: web


   .. py:attribute:: link_handlers
      :type:  dict[str, collections.abc.Callable]


   .. py:method:: draw(buf: str = '', web_context: Any | None = None, link_handler: collections.abc.Callable[[str], Any] | None = None) -> None


   .. py:method:: redraw() -> None


   .. py:method:: create_link(cmd: str, label: str, func: collections.abc.Callable, tip: str | None = None, id: str | None = None) -> str

      Generates HTML link element and registers link handler

      Arguments:
          cmd {str} -- Command name used for the JS → Python bridge
          label {str} -- Display label of the link
          func {Callable} -- Callable to be called on clicking the link

      Keyword Arguments:
          tip {Optional[str]} -- Optional tooltip text to show on hovering
                                 over the link (default: {None})
          id: {Optional[str]} -- Optional id attribute to supply the link with
                                 (default: {None})

      Returns:
          str -- HTML link element



   .. py:method:: set_sync_active(active: bool) -> None


   .. py:method:: set_sync_status(status: anki.sync.SyncStatus) -> None


   .. py:method:: update_sync_status() -> None


.. py:class:: BottomBar(mw: aqt.AnkiQt, web: aqt.webview.AnkiWebView)

   Bases: :py:obj:`Toolbar`


   .. py:method:: draw(buf: str = '', web_context: Any | None = None, link_handler: collections.abc.Callable[[str], Any] | None = None) -> None


