Add View menu with a toggle to hide/show the ffmpeg log panel

This commit is contained in:
ThePendulum
2026-07-26 01:24:34 +02:00
parent 660275bf02
commit f6e6f79a34
2 changed files with 48 additions and 1 deletions
+9 -1
View File
@@ -3,7 +3,7 @@ from pathlib import Path
from typing import Optional
from PyQt6.QtCore import Qt, QTimer, QThread, pyqtSignal
from PyQt6.QtGui import QShortcut, QKeySequence
from PyQt6.QtGui import QShortcut, QKeySequence, QAction
from PyQt6.QtWidgets import (
QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout,
QPushButton, QLabel, QSlider, QCheckBox, QDoubleSpinBox, QFileDialog,
@@ -55,6 +55,7 @@ class MainWindow(QMainWindow):
self.player.setMinimumHeight(400)
self._build_ui()
self._build_menu()
self._wire_shortcuts()
self._position_timer = QTimer(self)
@@ -155,6 +156,13 @@ class MainWindow(QMainWindow):
self.setCentralWidget(central)
def _build_menu(self):
view_menu = self.menuBar().addMenu("&View")
self.toggle_log_action = QAction("Show ffmpeg Log", self, checkable=True, checked=True)
self.toggle_log_action.toggled.connect(self.log_view.setVisible)
view_menu.addAction(self.toggle_log_action)
def _wire_shortcuts(self):
QShortcut(QKeySequence(","), self, activated=lambda: self._step_frame(-1))
QShortcut(QKeySequence("."), self, activated=lambda: self._step_frame(1))