commit 79
This commit is contained in:
Binary file not shown.
@@ -911,7 +911,7 @@ class CustomFileDialog(tk.Toplevel):
|
||||
self.icon_canvas.yview_scroll(delta, "units")
|
||||
# Check if scrolled to the bottom and if there are more items to load
|
||||
if self.currently_loaded_count < len(self.all_items) and self.icon_canvas.yview()[1] > 0.9:
|
||||
self._load_more_items_icon_view(container_frame)
|
||||
self._load_more_items_icon_view(container_frame, _on_mouse_wheel)
|
||||
|
||||
for widget in [self.icon_canvas, container_frame]:
|
||||
widget.bind("<MouseWheel>", _on_mouse_wheel)
|
||||
@@ -925,7 +925,7 @@ class CustomFileDialog(tk.Toplevel):
|
||||
return
|
||||
|
||||
widget_to_focus = self._load_more_items_icon_view(
|
||||
container_frame, item_to_rename, item_to_select)
|
||||
container_frame, _on_mouse_wheel, item_to_rename, item_to_select)
|
||||
|
||||
if widget_to_focus:
|
||||
def scroll_to_widget():
|
||||
@@ -944,7 +944,7 @@ class CustomFileDialog(tk.Toplevel):
|
||||
|
||||
self.after(100, scroll_to_widget)
|
||||
|
||||
def _load_more_items_icon_view(self, container, item_to_rename=None, item_to_select=None):
|
||||
def _load_more_items_icon_view(self, container, scroll_handler, item_to_rename=None, item_to_select=None):
|
||||
start_index = self.currently_loaded_count
|
||||
end_index = min(len(self.all_items), start_index +
|
||||
self.items_to_load_per_batch)
|
||||
@@ -999,6 +999,10 @@ class CustomFileDialog(tk.Toplevel):
|
||||
p=path: self._show_context_menu(e, p))
|
||||
widget.bind("<F2>", lambda e, p=path,
|
||||
f=item_frame: self.on_rename_request(e, p, f))
|
||||
# Bind mouse wheel scrolling to all widgets inside the item
|
||||
widget.bind("<MouseWheel>", scroll_handler)
|
||||
widget.bind("<Button-4>", scroll_handler)
|
||||
widget.bind("<Button-5>", scroll_handler)
|
||||
|
||||
if name == item_to_select:
|
||||
self.on_item_select(path, item_frame)
|
||||
|
Reference in New Issue
Block a user