aqt.toolbar#

Classes#

HideMode

Enum where members are also (and must be) ints

TopToolbar

BottomToolbar

ToolbarWebView

TopWebView

BottomWebView

Toolbar

BottomBar

Module Contents#

class aqt.toolbar.HideMode#

Bases: enum.IntEnum

Enum where members are also (and must be) ints

FULLSCREEN = 0#
ALWAYS = 1#
class aqt.toolbar.TopToolbar(toolbar: Toolbar)#
toolbar#
class aqt.toolbar.BottomToolbar(toolbar: Toolbar)#
toolbar#
class aqt.toolbar.ToolbarWebView(mw: aqt.AnkiQt, kind: aqt.webview.AnkiWebViewKind = AnkiWebViewKind.DEFAULT)#

Bases: aqt.webview.AnkiWebView

hide_condition: collections.abc.Callable[Ellipsis, bool]#
mw#
hidden = False#
hide_timer#
reset_timer() None#
hide() None#
show() None#
class aqt.toolbar.TopWebView(mw: aqt.AnkiQt)#

Bases: ToolbarWebView

web_height = 0#
eventFilter(obj, evt)#
on_body_classes_need_update() None#
hide_if_allowed() None#
hide() None#
show() None#
flatten() None#
elevate() None#
update_background_image() None#
set_body_height(height: int) None#
adjustHeightToFit() None#
resizeEvent(event: QResizeEvent | None) None#
class aqt.toolbar.BottomWebView(mw: aqt.AnkiQt)#

Bases: ToolbarWebView

eventFilter(obj, evt)#
on_body_classes_need_update() None#
animate_height(height: int) None#
hide_if_allowed() None#
hide() None#
show() None#
class aqt.toolbar.Toolbar(mw: aqt.AnkiQt, web: aqt.webview.AnkiWebView)#
mw#
web#
draw(buf: str = '', web_context: Any | None = None, link_handler: collections.abc.Callable[[str], Any] | None = None) None#
redraw() None#

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

set_sync_active(active: bool) None#
set_sync_status(status: anki.sync.SyncStatus) None#
update_sync_status() None#
class aqt.toolbar.BottomBar(mw: aqt.AnkiQt, web: aqt.webview.AnkiWebView)#

Bases: Toolbar

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