CTkScrollableDropdownPP 2.2__tar.gz → 2.3__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.
- {ctkscrollabledropdownpp-2.2 → ctkscrollabledropdownpp-2.3}/CTkScrollableDropdownPP/ctk_scrollable_dropdown.py +12 -15
- {ctkscrollabledropdownpp-2.2 → ctkscrollabledropdownpp-2.3}/CTkScrollableDropdownPP.egg-info/PKG-INFO +2 -2
- ctkscrollabledropdownpp-2.3/CTkScrollableDropdownPP.egg-info/requires.txt +2 -0
- {ctkscrollabledropdownpp-2.2 → ctkscrollabledropdownpp-2.3}/PKG-INFO +2 -2
- {ctkscrollabledropdownpp-2.2 → ctkscrollabledropdownpp-2.3}/pyproject.toml +3 -3
- ctkscrollabledropdownpp-2.2/CTkScrollableDropdownPP.egg-info/requires.txt +0 -2
- {ctkscrollabledropdownpp-2.2 → ctkscrollabledropdownpp-2.3}/CTkScrollableDropdownPP/__init__.py +0 -0
- {ctkscrollabledropdownpp-2.2 → ctkscrollabledropdownpp-2.3}/CTkScrollableDropdownPP.egg-info/SOURCES.txt +0 -0
- {ctkscrollabledropdownpp-2.2 → ctkscrollabledropdownpp-2.3}/CTkScrollableDropdownPP.egg-info/dependency_links.txt +0 -0
- {ctkscrollabledropdownpp-2.2 → ctkscrollabledropdownpp-2.3}/CTkScrollableDropdownPP.egg-info/top_level.txt +0 -0
- {ctkscrollabledropdownpp-2.2 → ctkscrollabledropdownpp-2.3}/LICENSE +0 -0
- {ctkscrollabledropdownpp-2.2 → ctkscrollabledropdownpp-2.3}/README.md +0 -0
- {ctkscrollabledropdownpp-2.2 → ctkscrollabledropdownpp-2.3}/setup.cfg +0 -0
|
@@ -144,8 +144,9 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
144
144
|
if self.pagination:
|
|
145
145
|
self.button_container = customtkinter.CTkFrame(self.frame, fg_color=self.fg_color)
|
|
146
146
|
self.button_container.pack(expand=True, fill="both")
|
|
147
|
-
|
|
148
|
-
self.pagination_frame.
|
|
147
|
+
|
|
148
|
+
self.pagination_frame = customtkinter.CTkFrame(self, fg_color=self.fg_color)
|
|
149
|
+
self.pagination_frame.pack(fill="x", pady=(3, 0))
|
|
149
150
|
else:
|
|
150
151
|
self.button_container = self.frame
|
|
151
152
|
self.dummy_entry = customtkinter.CTkEntry(self.frame, fg_color="transparent", border_width=0, height=1, width=1)
|
|
@@ -336,9 +337,7 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
336
337
|
total_pages = (len(values_list) + self.items_per_page - 1) // self.items_per_page
|
|
337
338
|
button_width = 30
|
|
338
339
|
button_padding = 4
|
|
339
|
-
available_width = self.pagination_frame.winfo_width()
|
|
340
|
-
if available_width < 1:
|
|
341
|
-
available_width = self.attach.winfo_width() if self.width is None else self.width
|
|
340
|
+
available_width = self.pagination_frame.winfo_width() or self.width_new or self.attach.winfo_width() or 200
|
|
342
341
|
max_buttons_per_row = max(1, available_width // (button_width + button_padding))
|
|
343
342
|
total_rows = (total_pages + max_buttons_per_row - 1) // max_buttons_per_row
|
|
344
343
|
for row in range(total_rows):
|
|
@@ -363,20 +362,18 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
363
362
|
|
|
364
363
|
def _change_page(self, page_index):
|
|
365
364
|
self.current_page = page_index
|
|
366
|
-
if self.filtered_values is
|
|
367
|
-
values_to_show = self.filtered_values[self.current_page * self.items_per_page:
|
|
368
|
-
(self.current_page + 1) * self.items_per_page]
|
|
369
|
-
else:
|
|
365
|
+
if self.filtered_values is None:
|
|
370
366
|
values_to_show = self.values[self.current_page * self.items_per_page:
|
|
371
367
|
(self.current_page + 1) * self.items_per_page]
|
|
372
368
|
self.update_buttons(values_to_show)
|
|
373
369
|
self._update_pagination_buttons(filtered=bool(self.filtered_values))
|
|
374
370
|
self.frame.update_idletasks()
|
|
375
|
-
|
|
371
|
+
ratio = len(values_to_show) / self.items_per_page
|
|
372
|
+
self.frame._parent_canvas.yview_moveto(0 if ratio < 0.5 else ratio)
|
|
376
373
|
|
|
377
374
|
def destroy_popup(self):
|
|
378
|
-
|
|
379
|
-
|
|
375
|
+
self.destroy()
|
|
376
|
+
self.disable = True
|
|
380
377
|
|
|
381
378
|
def place_dropdown(self):
|
|
382
379
|
if not self.winfo_exists():
|
|
@@ -453,7 +450,7 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
453
450
|
self.current_page = 0
|
|
454
451
|
self._init_buttons()
|
|
455
452
|
if self.pagination:
|
|
456
|
-
self.pagination_frame.pack(fill="x",
|
|
453
|
+
self.pagination_frame.pack(fill="x", pady=(3, 0))
|
|
457
454
|
self.fade = False
|
|
458
455
|
if not self.multiple:
|
|
459
456
|
self._animated_withdraw()
|
|
@@ -477,11 +474,11 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
477
474
|
values_to_show = filtered
|
|
478
475
|
self.update_buttons(values_to_show)
|
|
479
476
|
if self.pagination:
|
|
480
|
-
self.pagination_frame.pack(fill="x",
|
|
477
|
+
self.pagination_frame.pack(fill="x", pady=(3, 0))
|
|
481
478
|
self.place_dropdown()
|
|
482
479
|
else:
|
|
483
480
|
if self.pagination:
|
|
484
|
-
self.pagination_frame.pack(fill="x",
|
|
481
|
+
self.pagination_frame.pack(fill="x", pady=(3, 0))
|
|
485
482
|
self.filtered_values = None
|
|
486
483
|
self.current_page = 0
|
|
487
484
|
self._init_buttons()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: CTkScrollableDropdownPP
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3
|
|
4
4
|
Summary: Enhanced CTkScrollableDropdown with pagination, search and groups support
|
|
5
5
|
Author: PLauncher-Team, Akash Bora
|
|
6
6
|
License: MIT
|
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Requires-Python: >=3.8
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: customtkinter
|
|
15
|
+
Requires-Dist: customtkinter
|
|
16
16
|
Requires-Dist: pillow
|
|
17
17
|
Dynamic: license-file
|
|
18
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: CTkScrollableDropdownPP
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3
|
|
4
4
|
Summary: Enhanced CTkScrollableDropdown with pagination, search and groups support
|
|
5
5
|
Author: PLauncher-Team, Akash Bora
|
|
6
6
|
License: MIT
|
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Requires-Python: >=3.8
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: customtkinter
|
|
15
|
+
Requires-Dist: customtkinter
|
|
16
16
|
Requires-Dist: pillow
|
|
17
17
|
Dynamic: license-file
|
|
18
18
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools
|
|
2
|
+
requires = ["setuptools"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "CTkScrollableDropdownPP"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.3"
|
|
8
8
|
description = "Enhanced CTkScrollableDropdown with pagination, search and groups support"
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "PLauncher-Team"},
|
|
@@ -19,7 +19,7 @@ classifiers = [
|
|
|
19
19
|
]
|
|
20
20
|
keywords = ["customtkinter", "dropdown", "pagination", "search", "groups"]
|
|
21
21
|
dependencies = [
|
|
22
|
-
"customtkinter
|
|
22
|
+
"customtkinter",
|
|
23
23
|
"pillow"
|
|
24
24
|
]
|
|
25
25
|
|
{ctkscrollabledropdownpp-2.2 → ctkscrollabledropdownpp-2.3}/CTkScrollableDropdownPP/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|