theme chnages

This commit is contained in:
TomSchimansky 2022-11-27 21:33:12 +01:00
parent 596b017992
commit 1424eeac6c
4 changed files with 8 additions and 7 deletions

View File

@ -130,7 +130,7 @@
"DropdownMenu": { "DropdownMenu": {
"fg_color": ["gray90", "gray20"], "fg_color": ["gray90", "gray20"],
"hover_color": ["gray75", "gray28"], "hover_color": ["gray75", "gray28"],
"text_color": ["#DCE4EE", "#DCE4EE"] "text_color": ["gray10", "gray90"]
}, },
"CTkFont": { "CTkFont": {
"macOS": { "macOS": {

View File

@ -130,7 +130,7 @@
"DropdownMenu": { "DropdownMenu": {
"fg_color": ["gray90", "gray20"], "fg_color": ["gray90", "gray20"],
"hover_color": ["gray75", "gray28"], "hover_color": ["gray75", "gray28"],
"text_color": ["#DCE4EE", "#DCE4EE"] "text_color": ["gray10", "gray90"]
}, },
"CTkFont": { "CTkFont": {
"macOS": { "macOS": {

View File

@ -1,6 +1,6 @@
from tkinter.font import Font from tkinter.font import Font
import copy import copy
from typing import List, Callable, Tuple, Optional from typing import List, Callable, Tuple, Optional, Literal
from ..theme.theme_manager import ThemeManager from ..theme.theme_manager import ThemeManager
@ -23,8 +23,8 @@ class CTkFont(Font):
def __init__(self, def __init__(self,
family: Optional[str] = None, family: Optional[str] = None,
size: Optional[int] = None, size: Optional[int] = None,
weight: str = None, weight: Literal["normal", "bold"] = None,
slant: str = "roman", slant: Literal["italic", "roman"] = "roman",
underline: bool = False, underline: bool = False,
overstrike: bool = False): overstrike: bool = False):
@ -51,8 +51,9 @@ class CTkFont(Font):
self._size_configure_callback_list.remove(callback) self._size_configure_callback_list.remove(callback)
def create_scaled_tuple(self, font_scaling: float) -> Tuple[str, int, str]: def create_scaled_tuple(self, font_scaling: float) -> Tuple[str, int, str]:
""" return scaled tuple representation of font in the form (family: str, size: int, style: str)""" """ return scaled tuple representation of font in the form (family: str, size: int, style: str)"""
return self._family, round(self._size * font_scaling), self._tuple_style_string return self._family, round(-abs(self._size) * font_scaling), self._tuple_style_string
def config(self, *args, **kwargs): def config(self, *args, **kwargs):
raise AttributeError("'config' is not implemented for CTk widgets. For consistency, always use 'configure' instead.") raise AttributeError("'config' is not implemented for CTk widgets. For consistency, always use 'configure' instead.")

View File

@ -2,7 +2,7 @@ import tkinter
import customtkinter import customtkinter
customtkinter.set_appearance_mode("dark") # Modes: "System" (standard), "Dark", "Light" customtkinter.set_appearance_mode("dark") # Modes: "System" (standard), "Dark", "Light"
customtkinter.set_default_color_theme("dark-blue") # Themes: "blue" (standard), "green", "dark-blue" customtkinter.set_default_color_theme("blue") # Themes: "blue" (standard), "green", "dark-blue"
app = customtkinter.CTk() app = customtkinter.CTk()
app.geometry("1100x900") app.geometry("1100x900")