From d355f24394436a068a544c249bcafa976a21e782 Mon Sep 17 00:00:00 2001 From: pax Date: Sat, 11 Apr 2026 22:15:07 -0500 Subject: [PATCH] main_window: make S key guard consistent with B/F S key (toggle save) previously checked _preview._current_post which could be stale after tab switches or right-clicks. Now uses the same guard as B/F: requires posts loaded and a valid grid selection index. --- booru_viewer/gui/main_window.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/booru_viewer/gui/main_window.py b/booru_viewer/gui/main_window.py index d984f86..eee33f7 100644 --- a/booru_viewer/gui/main_window.py +++ b/booru_viewer/gui/main_window.py @@ -1084,9 +1084,11 @@ class BooruApp(QMainWindow): if 0 <= idx < len(self._posts): self._post_actions.toggle_bookmark(idx) return - if key == Qt.Key.Key_S and self._preview._current_post: - self._post_actions.toggle_save_from_preview() - return + if key == Qt.Key.Key_S and self._posts: + idx = self._grid.selected_index + if 0 <= idx < len(self._posts): + self._post_actions.toggle_save_from_preview() + return elif key == Qt.Key.Key_I: self._toggle_info() return