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
This commit is contained in:
Aristotelis 2022-10-03 04:50:22 +02:00 committed by GitHub
parent ccb18ec709
commit da4d80da2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)