From da4d80da2af88ac47f42f765e625d0a73921fcd1 Mon Sep 17 00:00:00 2001 From: Aristotelis Date: Mon, 3 Oct 2022 04:50:22 +0200 Subject: [PATCH] Add API shim for webview.get_window_bg_color (#2095) * Maintain shim for webview.get_window_bg_color Used by the AMBOSS add-on * Fix deprecation message --- qt/aqt/webview.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index 6c651b413..be856a31d 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -9,6 +9,7 @@ from typing import Any, Callable, Optional, Sequence, cast import anki import anki.lang +from anki._legacy import deprecated from anki.lang import is_rtl from anki.utils import is_lin, is_mac, is_win from aqt import colors, gui_hooks @@ -715,3 +716,7 @@ html {{ {font} }} }})(); """ ) + + @deprecated(info="use theme_manager.qcolor() instead") + def get_window_bg_color(self, night_mode: Optional[bool] = None) -> QColor: + return theme_manager.qcolor(colors.CANVAS)