Skip to content

Commit be3c280

Browse files
committed
Removing CTRL modify from scrollwheel support on video widget. Making it very easy to discover the ability to zoom in/out of the video preview widget. Added cursor logic for "resize" button.
1 parent 7e5ef0f commit be3c280

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/windows/video_widget.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,11 @@ def mouseMoveEvent(self, event):
376376
if self.mouse_dragging and not self.transform_mode:
377377
self.original_clip_data = self.transforming_clip.data
378378

379+
# Mouse over resize button (and not currently dragging)
380+
if not self.mouse_dragging and self.resize_button.isVisible() and self.resize_button.rect().contains(event.pos()):
381+
self.setCursor(Qt.ArrowCursor)
379382
# Determine if cursor is over a handle
380-
if self.transform.mapToPolygon(self.centerHandle.toRect()).containsPoint(event.pos(), Qt.OddEvenFill):
383+
elif self.transform.mapToPolygon(self.centerHandle.toRect()).containsPoint(event.pos(), Qt.OddEvenFill):
381384
if not self.transform_mode or self.transform_mode == 'origin':
382385
self.setCursor(self.rotateCursor(self.cursors.get('hand'), rotation, shear_x, shear_y))
383386
# Set the transform mode
@@ -734,16 +737,12 @@ def delayed_resize_callback(self):
734737

735738
# Capture wheel event to alter zoom/scale of widget
736739
def wheelEvent(self, event):
737-
if int(QCoreApplication.instance().keyboardModifiers() & Qt.ControlModifier) > 0:
738-
# For each 120 (standard scroll unit) adjust the zoom slider
739-
tick_scale = 1024
740-
self.zoom += event.angleDelta().y() / tick_scale
741-
if self.zoom <= 0.0:
742-
# Don't allow zoom to go all the way to zero (or negative)
743-
self.zoom = 0.05
744-
else:
745-
# Otherwise pass on to implement default functionality (scroll in QWebView)
746-
super(type(self), self).wheelEvent(event)
740+
# For each 120 (standard scroll unit) adjust the zoom slider
741+
tick_scale = 1024
742+
self.zoom += event.angleDelta().y() / tick_scale
743+
if self.zoom <= 0.0:
744+
# Don't allow zoom to go all the way to zero (or negative)
745+
self.zoom = 0.05
747746

748747
# Add resize button (if not 100% zoom)
749748
if self.zoom != 1.0:
@@ -801,6 +800,7 @@ def __init__(self, *args):
801800
self.resize_button.hide()
802801
self.resize_button.setStyleSheet('QPushButton { margin: 10px; padding: 2px; }')
803802
self.resize_button.clicked.connect(self.resize_button_clicked)
803+
self.resize_button.setMouseTracking(True)
804804

805805
# Initialize cursors
806806
self.cursors = { "move": QPixmap(os.path.join(info.IMAGES_PATH, "cursor_move.png")),

0 commit comments

Comments
 (0)