mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
1a57294ae9 | |||
ddd49377d4 |
@ -1,4 +1,4 @@
|
|||||||
__version__ = "4.5.7"
|
__version__ = "4.5.8"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
@ -143,6 +143,7 @@ class CTk(tkinter.Tk):
|
|||||||
def apply_geometry_scaling(self, geometry_string):
|
def apply_geometry_scaling(self, geometry_string):
|
||||||
value_list = re.split(r"[x+-]", geometry_string)
|
value_list = re.split(r"[x+-]", geometry_string)
|
||||||
separator_list = re.split(r"\d+", geometry_string)
|
separator_list = re.split(r"\d+", geometry_string)
|
||||||
|
print(separator_list)
|
||||||
|
|
||||||
if len(value_list) == 2:
|
if len(value_list) == 2:
|
||||||
scaled_width = str(round(int(value_list[0]) * self.window_scaling))
|
scaled_width = str(round(int(value_list[0]) * self.window_scaling))
|
||||||
@ -151,7 +152,7 @@ class CTk(tkinter.Tk):
|
|||||||
elif len(value_list) == 4:
|
elif len(value_list) == 4:
|
||||||
scaled_width = str(round(int(value_list[0]) * self.window_scaling))
|
scaled_width = str(round(int(value_list[0]) * self.window_scaling))
|
||||||
scaled_height = str(round(int(value_list[1]) * 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):
|
def reverse_geometry_scaling(self, scaled_geometry_string):
|
||||||
value_list = re.split(r"[x+-]", 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:
|
elif len(value_list) == 4:
|
||||||
width = str(round(int(value_list[0]) / self.window_scaling))
|
width = str(round(int(value_list[0]) / self.window_scaling))
|
||||||
height = str(round(int(value_list[1]) / 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):
|
def apply_window_scaling(self, value):
|
||||||
if isinstance(value, (int, float)):
|
if isinstance(value, (int, float)):
|
||||||
|
@ -94,7 +94,7 @@ class CTkToplevel(tkinter.Toplevel):
|
|||||||
elif len(value_list) == 4:
|
elif len(value_list) == 4:
|
||||||
scaled_width = str(round(int(value_list[0]) * self.window_scaling))
|
scaled_width = str(round(int(value_list[0]) * self.window_scaling))
|
||||||
scaled_height = str(round(int(value_list[1]) * 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):
|
def reverse_geometry_scaling(self, scaled_geometry_string):
|
||||||
value_list = re.split(r"[x+-]", 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:
|
elif len(value_list) == 4:
|
||||||
width = str(round(int(value_list[0]) / self.window_scaling))
|
width = str(round(int(value_list[0]) / self.window_scaling))
|
||||||
height = str(round(int(value_list[1]) / 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):
|
def apply_window_scaling(self, value):
|
||||||
if isinstance(value, (int, float)):
|
if isinstance(value, (int, float)):
|
||||||
|
@ -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.7"
|
current = "4.5.8"
|
||||||
|
|
||||||
# Example of a semver regexp.
|
# Example of a semver regexp.
|
||||||
# Make sure this matches current_version before
|
# Make sure this matches current_version before
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = customtkinter
|
name = customtkinter
|
||||||
version = 4.5.7
|
version = 4.5.8
|
||||||
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
|
||||||
|
Reference in New Issue
Block a user