Commit f4cb0436 authored by Julius Künzel's avatar Julius Künzel
Browse files

Improve cursor shape for keyframe view in timeline

Fixes #1203
parent 8d14944b
Pipeline #82847 passed with stage
in 9 minutes and 21 seconds
...@@ -165,16 +165,18 @@ Rectangle ...@@ -165,16 +165,18 @@ Rectangle
radius: width / 2 radius: width / 2
color: keyframeContainer.activeFrame == keyframe.frame ? 'red' : kf1MouseArea.containsMouse || kf1MouseArea.pressed ? root.textColor : root.videoColor color: keyframeContainer.activeFrame == keyframe.frame ? 'red' : kf1MouseArea.containsMouse || kf1MouseArea.pressed ? root.textColor : root.videoColor
border.color: kf1MouseArea.containsMouse || kf1MouseArea.pressed ? activePalette.highlight : root.textColor border.color: kf1MouseArea.containsMouse || kf1MouseArea.pressed ? activePalette.highlight : root.textColor
MouseArea { MouseArea {
id: kf1MouseArea id: kf1MouseArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: shiftPressed ? Qt.SizeVerCursor : Qt.PointingHandCursor
drag.target: parent drag.target: parent
drag.smoothed: false drag.smoothed: false
drag.threshold: 1 drag.threshold: 1
property string movingVal: kfrModel.realValue(model.normalizedValue) property string movingVal: kfrModel.realValue(model.normalizedValue)
property double newVal: NaN property double newVal: NaN
property bool shiftPressed: false
onPressed: { onPressed: {
drag.axis = (mouse.modifiers & Qt.ShiftModifier) ? Drag.YAxis : Drag.XAndYAxis drag.axis = (mouse.modifiers & Qt.ShiftModifier) ? Drag.YAxis : Drag.XAndYAxis
} }
...@@ -217,6 +219,7 @@ Rectangle ...@@ -217,6 +219,7 @@ Rectangle
} }
} }
onPositionChanged: { onPositionChanged: {
shiftPressed = (mouse.modifiers & Qt.ShiftModifier)
if (mouse.buttons === Qt.LeftButton) { if (mouse.buttons === Qt.LeftButton) {
if (frame == inPoint) { if (frame == inPoint) {
parent.x = - root.baseUnit / 2 parent.x = - root.baseUnit / 2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment