changed transparent color value from None to "transparent", fixed type hints, added color type and value checking

This commit is contained in:
Tom Schimansky
2022-11-10 23:27:55 +01:00
parent 1387e834b5
commit cbbc9efda3
27 changed files with 566 additions and 574 deletions

View File

@@ -21,8 +21,8 @@ class CTkFont(Font):
"""
def __init__(self,
family: str = "default_theme",
size: int = "default_theme",
family: str = "default",
size: int = "default",
weight: str = "normal",
slant: str = "roman",
underline: bool = False,
@@ -31,10 +31,10 @@ class CTkFont(Font):
self._size_configure_callback_list: List[Callable] = []
self._family = family
self._size = ThemeManager.theme["text"]["size"] if size == "default_theme" else size
self._size = ThemeManager.theme["text"]["size"] if size == "default" else size
self._tuple_style_string = f"{weight} {slant} {'underline' if underline else ''} {'overstrike' if overstrike else ''}"
super().__init__(family=ThemeManager.theme["text"]["font"] if family == "default_theme" else family,
super().__init__(family=ThemeManager.theme["text"]["font"] if family == "default" else family,
size=-abs(self._size),
weight=weight,
slant=slant,