fixed bug in CTkEntry, aligned text in CTkCheckBox

This commit is contained in:
Tom Schimansky
2022-02-08 20:59:50 +01:00
parent 0b081e0ef5
commit a8b9b4290c
6 changed files with 22 additions and 20 deletions

View File

@@ -111,7 +111,7 @@ class CTkButton(tkinter.Frame):
highlightthicknes=0,
width=self.width,
height=self.height)
self.canvas.grid(row=1, column=0, rowspan=2, columnspan=2)
self.canvas.grid(row=0, column=0, rowspan=2, columnspan=2, sticky="nsew")
# event bindings
if self.hover is True:

View File

@@ -258,8 +258,11 @@ class CTkCheckBox(tkinter.Frame):
self.text_label = tkinter.Label(master=self,
text=self.text,
justify=tkinter.LEFT,
width=len(self.text_color),
font=self.text_font)
self.text_label.pack(side='right', padx="4")
self.text_label.pack(side='right', padx=6)
self.text_label["anchor"] = "w"
if type(self.text_color) == tuple and len(self.text_color) == 2:
self.text_label.configure(fg=self.text_color[self.appearance_mode])

View File

@@ -39,10 +39,11 @@ class CTkColorManager:
elif theme_name.lower() == "green":
cls.WINDOW_BG = ("#ECECEC", "#323232") # macOS standard light and dark window bg colors
cls.MAIN = ("#29B57E", "#29B57E")
cls.MAIN_HOVER = ("#6ACBA5", "#6ACBA5")
cls.MAIN = ("#13C995", "#1ABE87")
cls.MAIN_HOVER = ("#6ACBA5", "#81E4B2")
cls.ENTRY = ("gray60", "#222223")
cls.TEXT = ("black", "white")
cls.TEXT = ("gray25", "gray92")
cls.PLACEHOLDER_TEXT = ("gray32", "gray55")
cls.LABEL_BG = ("white", "#626061")
cls.SLIDER_BG = ("#636363", "#0D1321")
cls.SLIDER_PROGRESS = ("white", "#727578")
@@ -58,6 +59,7 @@ class CTkColorManager:
cls.MAIN_HOVER = ("#A4BDE6", "#748BB3")
cls.ENTRY = ("#FCFCFC", "#111116")
cls.TEXT = ("black", "white")
cls.PLACEHOLDER_TEXT = ("gray52", "gray62")
cls.LABEL_BG = ("white", "#444444")
cls.SLIDER_BG = ("#444444", "#444444")
cls.SLIDER_PROGRESS = ("white", "#AAAAAA")

View File

@@ -85,7 +85,7 @@ class CTkEntry(tkinter.Frame):
highlightthicknes=0,
width=self.width,
height=self.height)
self.canvas.grid(column=0, row=0)
self.canvas.grid(column=0, row=0, sticky="we")
self.entry = tkinter.Entry(master=self,
bd=0,