Skip to content

Commit 0df714e

Browse files
committed
Add open file shortcut (ctrl+shift+O)
1 parent 6f40ed6 commit 0df714e

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tagstudio/src/qt/widgets/preview_panel.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import structlog
1414
from PIL import Image, UnidentifiedImageError
1515
from PIL.Image import DecompressionBombError
16-
from PySide6.QtCore import Signal, Qt, QSize
16+
from PySide6.QtCore import Signal, Qt, QSize, QKeyCombination
1717
from PySide6.QtGui import QResizeEvent, QAction
1818
from PySide6.QtWidgets import (
1919
QWidget,
@@ -99,6 +99,12 @@ def __init__(self, library: Library, driver: "QtDriver"):
9999
image_layout.setContentsMargins(0, 0, 0, 0)
100100

101101
self.open_file_action = QAction("Open file", self)
102+
self.open_file_action.setShortcut(
103+
QKeyCombination(
104+
Qt.KeyboardModifier.ControlModifier | Qt.KeyboardModifier.ShiftModifier,
105+
Qt.Key.Key_O,
106+
)
107+
)
102108
self.open_explorer_action = QAction("Open file in explorer", self)
103109

104110
self.preview_img = QPushButtonWrapper()

tagstudio/src/qt/widgets/video_player.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
QObject,
1515
QEvent,
1616
QRectF,
17+
QKeyCombination,
1718
)
1819
from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput, QMediaDevices
1920
from PySide6.QtMultimediaWidgets import QGraphicsVideoItem
@@ -128,6 +129,12 @@ def __init__(self, driver: "QtDriver") -> None:
128129

129130
open_file_action = QAction("Open file", self)
130131
open_file_action.triggered.connect(self.opener.open_file)
132+
open_file_action.setShortcut(
133+
QKeyCombination(
134+
Qt.KeyboardModifier.ControlModifier | Qt.KeyboardModifier.ShiftModifier,
135+
Qt.Key.Key_O,
136+
)
137+
)
131138
open_explorer_action = QAction("Open file in explorer", self)
132139
open_explorer_action.triggered.connect(self.opener.open_explorer)
133140
self.addAction(open_file_action)

0 commit comments

Comments
 (0)