2 Commits

Author SHA1 Message Date
1a57294ae9 Bump to 4.5.8 2022-07-17 21:45:45 +02:00
ddd49377d4 fixed geomtry method for CTk and CTkToplevel 2022-07-17 21:45:29 +02:00
5 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,4 @@
__version__ = "4.5.7"
__version__ = "4.5.8"
import os
import sys

View File

@ -143,6 +143,7 @@ class CTk(tkinter.Tk):
def apply_geometry_scaling(self, geometry_string):
value_list = re.split(r"[x+-]", geometry_string)
separator_list = re.split(r"\d+", geometry_string)
print(separator_list)
if len(value_list) == 2:
scaled_width = str(round(int(value_list[0]) * self.window_scaling))
@ -151,7 +152,7 @@ class CTk(tkinter.Tk):
elif len(value_list) == 4:
scaled_width = str(round(int(value_list[0]) * self.window_scaling))
scaled_height = str(round(int(value_list[1]) * self.window_scaling))
return f"{scaled_width}x{scaled_height}{separator_list[1]}{value_list[2]}{separator_list[2]}{value_list[3]}"
return f"{scaled_width}x{scaled_height}{separator_list[2]}{value_list[2]}{separator_list[3]}{value_list[3]}"
def reverse_geometry_scaling(self, scaled_geometry_string):
value_list = re.split(r"[x+-]", scaled_geometry_string)
@ -164,7 +165,7 @@ class CTk(tkinter.Tk):
elif len(value_list) == 4:
width = str(round(int(value_list[0]) / self.window_scaling))
height = str(round(int(value_list[1]) / self.window_scaling))
return f"{width}x{height}{separator_list[1]}{value_list[2]}{separator_list[2]}{value_list[3]}"
return f"{width}x{height}{separator_list[2]}{value_list[2]}{separator_list[3]}{value_list[3]}"
def apply_window_scaling(self, value):
if isinstance(value, (int, float)):

View File

@ -94,7 +94,7 @@ class CTkToplevel(tkinter.Toplevel):
elif len(value_list) == 4:
scaled_width = str(round(int(value_list[0]) * self.window_scaling))
scaled_height = str(round(int(value_list[1]) * self.window_scaling))
return f"{scaled_width}x{scaled_height}{separator_list[1]}{value_list[2]}{separator_list[2]}{value_list[3]}"
return f"{scaled_width}x{scaled_height}{separator_list[2]}{value_list[2]}{separator_list[3]}{value_list[3]}"
def reverse_geometry_scaling(self, scaled_geometry_string):
value_list = re.split(r"[x+-]", scaled_geometry_string)
@ -107,7 +107,7 @@ class CTkToplevel(tkinter.Toplevel):
elif len(value_list) == 4:
width = str(round(int(value_list[0]) / self.window_scaling))
height = str(round(int(value_list[1]) / self.window_scaling))
return f"{width}x{height}{separator_list[1]}{value_list[2]}{separator_list[2]}{value_list[3]}"
return f"{width}x{height}{separator_list[2]}{value_list[2]}{separator_list[3]}{value_list[3]}"
def apply_window_scaling(self, value):
if isinstance(value, (int, float)):

View File

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

View File

@ -1,6 +1,6 @@
[metadata]
name = customtkinter
version = 4.5.7
version = 4.5.8
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_content_type = text/markdown