MoreCustomTkinterWidgets 5.0.0__tar.gz → 5.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {morecustomtkinterwidgets-5.0.0/src/MoreCustomTkinterWidgets.egg-info → morecustomtkinterwidgets-5.2.0}/PKG-INFO +1 -1
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/pyproject.toml +1 -1
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/DateSelector.py +0 -11
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/FileExplorer.py +31 -18
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Separator.py +2 -2
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/__init__.py +3 -3
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0/src/MoreCustomTkinterWidgets.egg-info}/PKG-INFO +1 -1
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/LICENSE +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/README.md +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/setup.cfg +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/AnimatedImage.py +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/AskDialog.py +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/AskValue.py +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/BetterCTkImage.py +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Images/back_arrow_dark.png +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Images/back_arrow_light.png +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Images/error.png +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Images/file_dark.png +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Images/file_light.png +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Images/folder_dark.png +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Images/folder_light.png +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Images/forward_arrow_dark.png +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Images/forward_arrow_light.png +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Images/info.png +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Images/new_folder_dark.png +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Images/new_folder_light.png +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Images/warning.png +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Message.py +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/Selector.py +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets/SmoothFrame.py +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets.egg-info/SOURCES.txt +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets.egg-info/dependency_links.txt +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets.egg-info/requires.txt +0 -0
- {morecustomtkinterwidgets-5.0.0 → morecustomtkinterwidgets-5.2.0}/src/MoreCustomTkinterWidgets.egg-info/top_level.txt +0 -0
|
@@ -472,14 +472,3 @@ class DateSelectorButton(ctk.CTkButton):
|
|
|
472
472
|
|
|
473
473
|
def get(self) -> Date:
|
|
474
474
|
return self._date
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
win = ctk.CTk()
|
|
479
|
-
win.title("MoreCustomTkinterWidgets examples !")
|
|
480
|
-
win.geometry("500x500")
|
|
481
|
-
|
|
482
|
-
date_selector = DateSelector(win, default_date=Date(1, 1, 2000, date_format="dmy"))
|
|
483
|
-
date_selector.pack()
|
|
484
|
-
|
|
485
|
-
win.mainloop()
|
|
@@ -69,6 +69,14 @@ class FileExplorer(ctk.CTkFrame):
|
|
|
69
69
|
# creating widget
|
|
70
70
|
super().__init__(master, width, height, corner_radius, border_width, bg_color, fg_color, border_color,
|
|
71
71
|
background_corner_colors, overwrite_preferred_drawing_method, **kwargs)
|
|
72
|
+
self.grid_propagate(False)
|
|
73
|
+
self.grid_columnconfigure(0, weight=0)
|
|
74
|
+
self.grid_columnconfigure(1, weight=1)
|
|
75
|
+
self.grid_columnconfigure(2, weight=0)
|
|
76
|
+
self.grid_columnconfigure(3, weight=0)
|
|
77
|
+
self.grid_rowconfigure(0, weight=0)
|
|
78
|
+
self.grid_rowconfigure(1, weight=1)
|
|
79
|
+
self.grid_rowconfigure(2, weight=0)
|
|
72
80
|
|
|
73
81
|
self.response_type = responsetype
|
|
74
82
|
self.filetypes = filetypes
|
|
@@ -88,28 +96,28 @@ class FileExplorer(ctk.CTkFrame):
|
|
|
88
96
|
self.folder_image = ctk.CTkImage(Image.open(os.path.join(os.path.dirname(__file__), "Images/folder_light.png")), Image.open(os.path.join(os.path.dirname(__file__), "Images/folder_dark.png")))
|
|
89
97
|
self.file_image = ctk.CTkImage(Image.open(os.path.join(os.path.dirname(__file__), "Images/file_light.png")), Image.open(os.path.join(os.path.dirname(__file__), "Images/file_dark.png")))
|
|
90
98
|
|
|
91
|
-
self.canvas = ctk.CTkCanvas(self,
|
|
99
|
+
self.canvas = ctk.CTkCanvas(self, highlightthickness=0)
|
|
92
100
|
if fg_color == "transparent":
|
|
93
101
|
self.canvas.configure(bg=self._apply_appearance_mode(self.cget("bg")))
|
|
94
102
|
else:
|
|
95
103
|
self.canvas.configure(bg=self._apply_appearance_mode(self.cget("fg_color")))
|
|
96
104
|
|
|
97
|
-
self.explorer_frame = ctk.CTkFrame(self.canvas,
|
|
105
|
+
self.explorer_frame = ctk.CTkFrame(self.canvas, fg_color=fg_color)
|
|
98
106
|
|
|
99
107
|
self.back_button = ctk.CTkButton(self, image=ctk.CTkImage(Image.open(os.path.join(os.path.dirname(__file__), "Images/back_arrow_light.png")), Image.open(os.path.join(os.path.dirname(__file__), "Images/back_arrow_dark.png"))), text="", command=self._move_back, width=35)
|
|
100
|
-
self.path_entry = ctk.CTkEntry(self, textvariable=self.selected_path
|
|
108
|
+
self.path_entry = ctk.CTkEntry(self, textvariable=self.selected_path)
|
|
101
109
|
self.create_dir_button = ctk.CTkButton(self, image=ctk.CTkImage(Image.open(os.path.join(os.path.dirname(__file__), "Images/new_folder_light.png")), Image.open(os.path.join(os.path.dirname(__file__), "Images/new_folder_dark.png"))), text="", command=self._create_directory, width=35)
|
|
102
|
-
self.y_scrollbar = ctk.CTkScrollbar(self,
|
|
103
|
-
self.x_scrollbar = ctk.CTkScrollbar(self, orientation="horizontal",
|
|
110
|
+
self.y_scrollbar = ctk.CTkScrollbar(self, command=self.canvas.yview)
|
|
111
|
+
self.x_scrollbar = ctk.CTkScrollbar(self, orientation="horizontal", command=self.canvas.xview)
|
|
104
112
|
self.canvas.configure(yscrollcommand=self.y_scrollbar.set)
|
|
105
113
|
self.after(100, lambda: self.canvas.configure(xscrollcommand=self.x_scrollbar.set)) # you have to bind the other scrollbar at least 50ms after the first one, idk why but it works
|
|
106
114
|
|
|
107
|
-
self.back_button.grid(row=0, column=0)
|
|
108
|
-
self.path_entry.grid(row=0, column=1, padx=
|
|
109
|
-
self.create_dir_button.grid(row=0, column=2)
|
|
110
|
-
self.canvas.grid(row=1, column=0, columnspan=3)
|
|
111
|
-
self.y_scrollbar.grid(row=1, column=3, rowspan=2)
|
|
112
|
-
self.x_scrollbar.grid(row=2, column=0, columnspan=3)
|
|
115
|
+
self.back_button.grid(row=0, column=0, padx=3, pady=3, sticky="nw")
|
|
116
|
+
self.path_entry.grid(row=0, column=1, padx=3, pady=3, sticky="new")
|
|
117
|
+
self.create_dir_button.grid(row=0, column=2, columnspan=2, padx=3, pady=3, sticky="ne")
|
|
118
|
+
self.canvas.grid(row=1, column=0, columnspan=3, padx=3, pady=3, sticky="nsew")
|
|
119
|
+
self.y_scrollbar.grid(row=1, column=3, rowspan=2, sticky="nse")
|
|
120
|
+
self.x_scrollbar.grid(row=2, column=0, columnspan=3, sticky="sew")
|
|
113
121
|
|
|
114
122
|
self.canvas.create_window((1, 1), window=self.explorer_frame, anchor="nw")
|
|
115
123
|
|
|
@@ -240,7 +248,7 @@ class FileExplorer(ctk.CTkFrame):
|
|
|
240
248
|
|
|
241
249
|
class Filedialog(ctk.CTkToplevel):
|
|
242
250
|
def __init__(self, responsetype: Literal["file", "directory"], title: str, filetypes: list[str] = None,
|
|
243
|
-
initialdir: str = None, initialfile: str = None):
|
|
251
|
+
initialdir: str = None, initialfile: str = None, geometry: str = "400x550"):
|
|
244
252
|
"""Creates a filedialog instance to ask for a file / directory
|
|
245
253
|
|
|
246
254
|
:param responsetype: type of the selected response: "file" / "directory"
|
|
@@ -248,6 +256,7 @@ class Filedialog(ctk.CTkToplevel):
|
|
|
248
256
|
:param filetypes: extension of the file to enter: ("text", ".txt"), None if the response should be a directory
|
|
249
257
|
:param initialdir: initial directory to start the search from, None if initialfile is not None
|
|
250
258
|
:param initialfile: initial file selected
|
|
259
|
+
:param geometry: initial geometry of the toplevel, default is "400x500"
|
|
251
260
|
"""
|
|
252
261
|
self.path = None
|
|
253
262
|
|
|
@@ -257,18 +266,22 @@ class Filedialog(ctk.CTkToplevel):
|
|
|
257
266
|
self.grab_set() # make other windows not clickable
|
|
258
267
|
|
|
259
268
|
self.title(title)
|
|
260
|
-
self.geometry(
|
|
261
|
-
self.resizable(False, False)
|
|
269
|
+
self.geometry(geometry)
|
|
262
270
|
|
|
263
271
|
self.protocol("WM_DELETE_WINDOW", self._kill_event)
|
|
264
272
|
|
|
265
|
-
self.explorer = FileExplorer(self, responsetype, filetypes, initialdir, initialfile
|
|
273
|
+
self.explorer = FileExplorer(self, responsetype, filetypes, initialdir, initialfile)
|
|
266
274
|
self.ok_button = ctk.CTkButton(self, text="Ok", command=self._ok_event)
|
|
267
275
|
self.cancel_button = ctk.CTkButton(self, text="Cancel", command=self._cancel_event)
|
|
268
276
|
|
|
269
|
-
self.
|
|
270
|
-
self.
|
|
271
|
-
self.
|
|
277
|
+
self.grid_columnconfigure(0, weight=1)
|
|
278
|
+
self.grid_columnconfigure(1, weight=1)
|
|
279
|
+
self.grid_rowconfigure(0, weight=1)
|
|
280
|
+
self.grid_rowconfigure(1, weight=0)
|
|
281
|
+
|
|
282
|
+
self.explorer.grid(row=0, column=0, columnspan=2, sticky="nsew")
|
|
283
|
+
self.ok_button.grid(row=1, column=0, sticky="ew", padx=5, pady=5)
|
|
284
|
+
self.cancel_button.grid(row=1, column=1, sticky="ew", padx=5, pady=5)
|
|
272
285
|
|
|
273
286
|
self.bind("<Return>", self._ok_event)
|
|
274
287
|
self.bind("<Escape>", self._cancel_event)
|
|
@@ -33,11 +33,11 @@ class Separator(ctk.CTkBaseClass):
|
|
|
33
33
|
self._orientation = orientation
|
|
34
34
|
|
|
35
35
|
self._canvas = ctk.CTkCanvas(self, highlightthickness=0)
|
|
36
|
-
self._canvas.
|
|
36
|
+
self._canvas.place(x=0, y=0, relwidth=1, relheight=1)
|
|
37
37
|
self._canvas.configure(bg=self._apply_appearance_mode(self._detect_color_of_master()), width=self._apply_widget_scaling(width), height=self._apply_widget_scaling(height))
|
|
38
38
|
self._draw_engine = ctk.DrawEngine(self._canvas)
|
|
39
39
|
|
|
40
|
-
self._draw()
|
|
40
|
+
self._draw(no_color_updates=True)
|
|
41
41
|
|
|
42
42
|
def _set_scaling(self, *args, **kwargs):
|
|
43
43
|
super()._set_scaling(*args, **kwargs)
|
|
@@ -7,8 +7,8 @@ from .SmoothFrame import SmoothFrame, get_coordinates_from_grid
|
|
|
7
7
|
from .BetterCTkImage import BetterCTkImage
|
|
8
8
|
from .AnimatedImage import AnimatedImage
|
|
9
9
|
from .Separator import Separator
|
|
10
|
-
from .
|
|
10
|
+
from .DateSelector import Date, DateSelector, DateSelectorButton
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
_version = "5.
|
|
14
|
-
__version__ = "5.
|
|
13
|
+
_version = "5.2.0"
|
|
14
|
+
__version__ = "5.2.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|