mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Honor night mode when switching between cards in card info
This commit is contained in:
parent
4a55f69e48
commit
c8f8a9cd2f
1 changed files with 8 additions and 1 deletions
|
@ -65,11 +65,18 @@ class CardInfoDialog(QDialog):
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
|
|
||||||
def update_card(self, card_id: CardId | None) -> None:
|
def update_card(self, card_id: CardId | None) -> None:
|
||||||
|
from aqt.theme import theme_manager
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.mw.col.get_card(card_id)
|
self.mw.col.get_card(card_id)
|
||||||
except NotFoundError:
|
except NotFoundError:
|
||||||
card_id = None
|
card_id = None
|
||||||
self.web.eval(f"window.location.href = '/card-info/{card_id}';")
|
|
||||||
|
if theme_manager.night_mode:
|
||||||
|
extra = "#night"
|
||||||
|
else:
|
||||||
|
extra = ""
|
||||||
|
self.web.eval(f"window.location.href = '/card-info/{card_id}{extra}';")
|
||||||
|
|
||||||
def reject(self) -> None:
|
def reject(self) -> None:
|
||||||
if self._on_close:
|
if self._on_close:
|
||||||
|
|
Loading…
Reference in a new issue