Skip to content

Commit

Permalink
fixes ozmartian#3
Browse files Browse the repository at this point in the history
  • Loading branch information
morzhakovanton committed Feb 18, 2024
1 parent 6ae8521 commit 445c52f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion vidcutter/libs/mpvwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def mouseDoubleClickEvent(self, event: QMouseEvent) -> None:
self.parent.toggleFullscreen()

def wheelEvent(self, event: QWheelEvent) -> None:
self.parent.videoSlider.wheelEvent(event)
self.parent.scalableTimeline.wheelEvent(event)

def paintEngine(self):
pass
9 changes: 6 additions & 3 deletions vidcutter/widgets/scalable_timeline_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

from PyQt5 import QtWidgets, QtGui, QtCore
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import Qt, QPoint, QLine, QRect, QRectF, pyqtSignal, QEvent, QObject, QTime
from PyQt5.QtGui import QPainter, QMouseEvent, QColor, QFont, QBrush, QPalette, QPen, QPolygon, QPainterPath, QPixmap
from PyQt5.QtWidgets import QStyle, QStylePainter, QWidget, QStyleOptionSlider, QScrollArea, QVBoxLayout, QPushButton, QHBoxLayout, QLabel
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QWheelEvent
from PyQt5.QtWidgets import QScrollArea

from vidcutter.VideoItemClip import VideoItemClip
from vidcutter.VideoList import VideoList
Expand Down Expand Up @@ -175,5 +175,8 @@ def setRestrictValue(self, value: int = 0, force: bool = False) -> None:
self._handleHover = False
# self.initStyle()

def wheelEvent(self, event: QWheelEvent) -> None:
self.timeline.wheelEvent(event)

# def keyPressEvent(self, a0):
# self.parent.keyPressEvent(a0)
15 changes: 12 additions & 3 deletions vidcutter/widgets/timeline_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

from PyQt5 import QtWidgets, QtGui, QtCore
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import Qt, QPoint, QLine, QRect, QRectF, pyqtSignal, QEvent, QObject, QTime
from PyQt5.QtGui import QPainter, QMouseEvent, QColor, QFont, QBrush, QPalette, QPen, QPolygon, QPainterPath, QPixmap
from PyQt5.QtWidgets import QStyle, QStylePainter, QWidget, QStyleOptionSlider, QScrollArea, QVBoxLayout, QPushButton, QHBoxLayout, QLabel
from PyQt5.QtCore import Qt, QPoint, QLine, QRect, pyqtSignal, QEvent, QObject, QTime
from PyQt5.QtGui import QPainter, QMouseEvent, QWheelEvent, QColor, QFont, QBrush, QPalette, QPen, QPolygon
from PyQt5.QtWidgets import QStyle, QStylePainter, QWidget, QStyleOptionSlider

from vidcutter.VideoItemClip import VideoItemClip
from vidcutter.VideoList import VideoList
Expand Down Expand Up @@ -442,6 +442,15 @@ def mouseCursorState(self, e_pos) -> CursorStates:
return self.CursorStates.cursorIsInside
return self.CursorStates.cursorIsOutside

def wheelEvent(self, event: QWheelEvent) -> None:
if self.parent.parent.mediaAvailable:
if event.angleDelta().y() > 0:
self.parent.parent.mpvWidget.frameBackStep()
else:
self.parent.parent.mpvWidget.frameStep()
self.parent.parent.setPlayButton(False)
event.accept()

def mouseCursorClipIndex(self, e_pos) -> int:
if len(self.clipsRectangles_) > 0:
for clipIndex in range(len(self.clipsRectangles_)):
Expand Down

0 comments on commit 445c52f

Please sign in to comment.