move deck name into window title; v-center sticky bar

This commit is contained in:
Damien Elmes 2021-05-19 19:34:15 +10:00
parent 3f0fd548d8
commit df38788e07
3 changed files with 5 additions and 6 deletions

View File

@ -6,7 +6,7 @@ from __future__ import annotations
import aqt
from aqt import gui_hooks
from aqt.qt import *
from aqt.utils import addCloseShortcut, disable_help_button, restoreGeom, saveGeom
from aqt.utils import addCloseShortcut, disable_help_button, restoreGeom, saveGeom, tr
from aqt.webview import AnkiWebView
@ -38,11 +38,12 @@ class DeckOptionsDialog(QDialog):
layout.addWidget(self.web)
self.setLayout(layout)
deck_id = self.mw.col.decks.get_current_id()
deck = self.mw.col.decks.get_current()
self.web.eval(
f"""const $deckOptions = anki.deckOptions(
document.getElementById('main'), {deck_id});"""
document.getElementById('main'), {deck.id});"""
)
self.setWindowTitle(tr.actions_options_for(val=deck.name))
gui_hooks.deck_options_did_load(self)
def reject(self) -> None:

View File

@ -21,6 +21,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
}
</style>
<nav {id} class={`pb-1 ${className}`}>
<nav {id} class={`pb-1 pt-1 ${className}`}>
<slot />
</nav>

View File

@ -31,8 +31,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</script>
<StickyBar>
<div>{tr.actionsOptionsFor({ val: state.currentDeck.name })}</div>
<WithTheming style="--toolbar-size: 35px; --toolbar-wrap: nowrap">
<ButtonToolbar class="justify-content-between">
<ButtonToolbarItem>