-
-
Notifications
You must be signed in to change notification settings - Fork 394
fix: ui/ux parity fixes for thumbnails and files #608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
db2c478
87869a5
49de868
6077d7a
bb480c9
b861afd
96d7df5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Copyright (C) 2024 Travis Abendshien (CyanVoxel). | ||
# Licensed under the GPL-3.0 License. | ||
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio | ||
|
||
|
||
class NoRendererError(Exception): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1030,25 +1030,41 @@ def update_thumbs(self): | |
self.flow_container.layout().update() | ||
self.main_window.update() | ||
|
||
for idx, (entry, item_thumb) in enumerate( | ||
zip_longest(self.frame_content, self.item_thumbs) | ||
): | ||
is_grid_thumb = True | ||
# Show loading placeholder icons | ||
for entry, item_thumb in zip_longest(self.frame_content, self.item_thumbs): | ||
if not entry: | ||
item_thumb.hide() | ||
continue | ||
|
||
filepath = self.lib.library_dir / entry.path | ||
item_thumb = self.item_thumbs[idx] | ||
item_thumb.set_mode(ItemType.ENTRY) | ||
item_thumb.set_item_id(entry) | ||
|
||
# TODO - show after item is rendered | ||
item_thumb.show() | ||
|
||
is_loading = True | ||
self.thumb_job_queue.put( | ||
( | ||
item_thumb.renderer.render, | ||
(sys.float_info.max, "", base_size, ratio, is_loading, is_grid_thumb), | ||
) | ||
) | ||
|
||
# Show rendered thumbnails | ||
for idx, (entry, item_thumb) in enumerate( | ||
zip_longest(self.frame_content, self.item_thumbs) | ||
): | ||
if not entry: | ||
continue | ||
|
||
filepath = self.lib.library_dir / entry.path | ||
is_loading = False | ||
|
||
self.thumb_job_queue.put( | ||
( | ||
item_thumb.renderer.render, | ||
(sys.float_info.max, "", base_size, ratio, True, True), | ||
(time.time(), filepath, base_size, ratio, is_loading, is_grid_thumb), | ||
) | ||
) | ||
|
||
|
@@ -1187,7 +1203,8 @@ def open_library(self, path: Path) -> LibraryStatus: | |
self.filter.page_size = self.lib.prefs(LibraryPrefs.PAGE_SIZE) | ||
|
||
# TODO - make this call optional | ||
self.add_new_files_callback() | ||
if self.lib.entries_count < 10000: | ||
self.add_new_files_callback() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change what the todo refers to? If so can it be removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I left the |
||
|
||
self.update_libs_list(path) | ||
title_text = f"{self.base_title} - Library '{self.lib.library_dir}'" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this not be hardcoded? As far as I can tell this is never changed and only accessed once
(same in the next loop)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be hard-coded, but the reason I split it off into a variable is due to the way the arguments are being passed where I'm unable to use named parameters. It took some time to sort out which of the existing unnamed boolean arguments were doing what here, so I opted to store them in named variables for clarity.