Skip to content

Commit

Permalink
Add open file shortcut (ctrl+shift+O)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrannicodin committed Sep 6, 2024
1 parent 477e7c1 commit 86d5781
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tagstudio/src/qt/widgets/preview_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import structlog
from PIL import Image, UnidentifiedImageError
from PIL.Image import DecompressionBombError
from PySide6.QtCore import Signal, Qt, QSize
from PySide6.QtCore import Signal, Qt, QSize, QKeyCombination
from PySide6.QtGui import QResizeEvent, QAction
from PySide6.QtWidgets import (
QWidget,
Expand Down Expand Up @@ -99,6 +99,12 @@ def __init__(self, library: Library, driver: "QtDriver"):
image_layout.setContentsMargins(0, 0, 0, 0)

self.open_file_action = QAction("Open file", self)
self.open_file_action.setShortcut(
QKeyCombination(
Qt.KeyboardModifier.ControlModifier | Qt.KeyboardModifier.ShiftModifier,
Qt.Key.Key_O,
)
)
self.open_explorer_action = QAction("Open file in explorer", self)

self.preview_img = QPushButtonWrapper()
Expand Down
7 changes: 7 additions & 0 deletions tagstudio/src/qt/widgets/video_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
QObject,
QEvent,
QRectF,
QKeyCombination,
)
from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput, QMediaDevices
from PySide6.QtMultimediaWidgets import QGraphicsVideoItem
Expand Down Expand Up @@ -128,6 +129,12 @@ def __init__(self, driver: "QtDriver") -> None:

open_file_action = QAction("Open file", self)
open_file_action.triggered.connect(self.opener.open_file)
open_file_action.setShortcut(
QKeyCombination(
Qt.KeyboardModifier.ControlModifier | Qt.KeyboardModifier.ShiftModifier,
Qt.Key.Key_O,
)
)
open_explorer_action = QAction("Open file in explorer", self)
open_explorer_action.triggered.connect(self.opener.open_explorer)
self.addAction(open_file_action)
Expand Down

0 comments on commit 86d5781

Please sign in to comment.