3 Commits

Author SHA1 Message Date
156a1863f5 Bump to 4.5.10 2022-07-23 20:03:59 +02:00
e295674e00 fixed bug in CTkLabel with multiline strings 2022-07-23 19:09:53 +02:00
36702326fa fixed checkbox size bug when rescaling 2022-07-18 13:02:39 +02:00
6 changed files with 12 additions and 8 deletions

View File

@ -1,4 +1,4 @@
__version__ = "4.5.9" __version__ = "4.5.10"
import os import os
import sys import sys

View File

@ -118,6 +118,7 @@ class CTkCheckBox(CTkBaseClass):
self.grid_columnconfigure(1, weight=0, minsize=self.apply_widget_scaling(6)) self.grid_columnconfigure(1, weight=0, minsize=self.apply_widget_scaling(6))
self.text_label.configure(font=self.apply_font_scaling(self.text_font)) self.text_label.configure(font=self.apply_font_scaling(self.text_font))
self.canvas.delete("checkmark")
self.bg_canvas.configure(width=self.apply_widget_scaling(self._desired_width), height=self.apply_widget_scaling(self._desired_height)) self.bg_canvas.configure(width=self.apply_widget_scaling(self._desired_width), height=self.apply_widget_scaling(self._desired_height))
self.canvas.configure(width=self.apply_widget_scaling(self._desired_width), height=self.apply_widget_scaling(self._desired_height)) self.canvas.configure(width=self.apply_widget_scaling(self._desired_width), height=self.apply_widget_scaling(self._desired_height))
self.draw() self.draw()

View File

@ -119,7 +119,8 @@ class CTkLabel(CTkBaseClass):
sticky=text_label_grid_sticky) sticky=text_label_grid_sticky)
if "text" in kwargs: if "text" in kwargs:
self.set_text(kwargs["text"]) self.text = kwargs["text"]
self.text_label.configure(text=self.text)
del kwargs["text"] del kwargs["text"]
if "fg_color" in kwargs: if "fg_color" in kwargs:
@ -148,5 +149,7 @@ class CTkLabel(CTkBaseClass):
self.text_label.configure(**kwargs) # pass remaining kwargs to label self.text_label.configure(**kwargs) # pass remaining kwargs to label
def set_text(self, text): def set_text(self, text):
""" Will be removed in the next major release """
self.text = text self.text = text
self.text_label.configure(text=self.text, width=len(self.text)) self.text_label.configure(text=self.text)

View File

@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
github_url = "https://github.com/TomSchimansky/CustomTkinter" github_url = "https://github.com/TomSchimansky/CustomTkinter"
[tool.tbump.version] [tool.tbump.version]
current = "4.5.9" current = "4.5.10"
# Example of a semver regexp. # Example of a semver regexp.
# Make sure this matches current_version before # Make sure this matches current_version before

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = customtkinter name = customtkinter
version = 4.5.9 version = 4.5.10
description = Create modern looking GUIs with Python description = Create modern looking GUIs with Python
long_description = CustomTkinter UI-Library\n\n[](https://github.com/TomSchimansky/CustomTkinter/blob/master/documentation_images/Windows_dark.png)\n\nMore Information: https://github.com/TomSchimansky/CustomTkinter long_description = CustomTkinter UI-Library\n\n[](https://github.com/TomSchimansky/CustomTkinter/blob/master/documentation_images/Windows_dark.png)\n\nMore Information: https://github.com/TomSchimansky/CustomTkinter
long_description_content_type = text/markdown long_description_content_type = text/markdown

View File

@ -37,9 +37,9 @@ class App(customtkinter.CTk):
self.appearance_mode_optionemenu = customtkinter.CTkOptionMenu(self.sidebar_frame, values=["Light", "Dark", "System"], self.appearance_mode_optionemenu = customtkinter.CTkOptionMenu(self.sidebar_frame, values=["Light", "Dark", "System"],
command=self.change_appearance_mode) command=self.change_appearance_mode)
self.appearance_mode_optionemenu.grid(row=6, column=0, padx=20, pady=(10, 10)) self.appearance_mode_optionemenu.grid(row=6, column=0, padx=20, pady=(10, 10))
self.scaling_label = customtkinter.CTkLabel(self.sidebar_frame, text="Widget Scaling:", anchor="w") self.scaling_label = customtkinter.CTkLabel(self.sidebar_frame, text="UI Scaling:", anchor="w")
self.scaling_label.grid(row=7, column=0, padx=20, pady=(10, 0)) self.scaling_label.grid(row=7, column=0, padx=20, pady=(10, 0))
self.scaling_optionemenu = customtkinter.CTkOptionMenu(self.sidebar_frame, values=["90%", "100%", "110%"], self.scaling_optionemenu = customtkinter.CTkOptionMenu(self.sidebar_frame, values=["80%", "90%", "100%", "110%", "120%"],
command=self.change_scaling) command=self.change_scaling)
self.scaling_optionemenu.grid(row=8, column=0, padx=20, pady=(10, 20)) self.scaling_optionemenu.grid(row=8, column=0, padx=20, pady=(10, 20))