changing key shortcuts for tab navigation

This commit is contained in:
Bernd 2025-08-06 13:33:29 +05:00
parent c0a37c4b45
commit 4c3265242d

View File

@ -64,7 +64,6 @@ class AnimeDialog(QDialog):
self.name_edit.setText(html.unescape(entry[1]))
self.year_spin.setValue(entry[2])
self.season_combo.setCurrentText((entry[3] or "Other").capitalize())
print("entry[3] = " + entry[3])
self.status_combo.setCurrentText(entry[4])
self.type_combo.setCurrentText(entry[5] or '')
self.comment_edit.setPlainText(html.unescape(entry[6] or ''))
@ -111,8 +110,8 @@ class ShortcutsDialog(QDialog):
shortcuts_text.setPlainText("""
Global Shortcuts:
- A: Add an anime
- Page Down: Next tab
- Page Up: Previous tab
- Ctrl + Page Down: Next tab
- Ctrl + Page Up: Previous tab
- Ctrl + Q: Quit the program
- R: Pick random anime
- Ctrl + + : Increase table scale
@ -820,14 +819,6 @@ class AnimeTracker(QMainWindow):
if modifiers == Qt.NoModifier:
if key == Qt.Key_A:
self.add_anime()
elif key == Qt.Key_PageDown:
current = self.tab_widget.currentIndex()
if current < self.tab_widget.count() - 1:
self.tab_widget.setCurrentIndex(current + 1)
elif key == Qt.Key_PageUp:
current = self.tab_widget.currentIndex()
if current > 0:
self.tab_widget.setCurrentIndex(current - 1)
elif key == Qt.Key_R:
self.random_pick()
elif key == Qt.Key_Q:
@ -846,6 +837,14 @@ class AnimeTracker(QMainWindow):
self.set_current_tab_by_identifier(current_id)
elif key == Qt.Key_Q:
self.close()
elif key == Qt.Key_PageDown:
current = self.tab_widget.currentIndex()
if current < self.tab_widget.count() - 1:
self.tab_widget.setCurrentIndex(current + 1)
elif key == Qt.Key_PageUp:
current = self.tab_widget.currentIndex()
if current > 0:
self.tab_widget.setCurrentIndex(current - 1)
super().keyPressEvent(event)