main_window: set _categories_pending BEFORE set_post renders
The flag was set in _ensure_post_categories_async which runs AFTER _on_post_selected calls info_panel.set_post. By the time the flag was True, the flat tags had already rendered. The flash persisted. Fix: check whether a fetch is needed and set the flag in _on_post_selected, right before set_post. The info panel sees the flag and skips the flat-tag fallback on its first render.
This commit is contained in:
parent
a86941decf
commit
4c490498e0
@ -1137,6 +1137,16 @@ class BooruApp(QMainWindow):
|
||||
+ (f" {post.created_at}" if post.created_at else "")
|
||||
)
|
||||
if self._info_panel.isVisible():
|
||||
# Signal the info panel whether a category fetch is
|
||||
# about to fire so it skips the flat-tag fallback
|
||||
# (avoids the flat→categorized re-layout flash).
|
||||
if not post.tag_categories:
|
||||
client = self._make_client()
|
||||
self._info_panel._categories_pending = (
|
||||
client is not None and client.category_fetcher is not None
|
||||
)
|
||||
else:
|
||||
self._info_panel._categories_pending = False
|
||||
self._info_panel.set_post(post)
|
||||
self._on_post_activated(index)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user