Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix erratic keyframe parameter height zoom function #1188

Merged
merged 3 commits into from Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/qml/views/keyframes/Parameter.qml
Expand Up @@ -30,6 +30,11 @@ Item {

signal clicked(var keyframe, var parameter)

function setLowestHighest(lh) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name suggestions:
Change "setLowestHighest" to "setMinMax"
Change "lh" to "zoomHeight"
thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I have no problem with changing names.
Updated with two commits below.

minimum = lh ? model.lowest : model.minimum
maximum = lh ? model.highest : model.maximum
}

function getKeyframeCount() {
return keyframesRepeater.count
}
Expand Down
7 changes: 6 additions & 1 deletion src/qml/views/keyframes/ParameterHead.qml
Expand Up @@ -28,6 +28,7 @@ Rectangle {
property bool selected: false
property bool current: false
property bool isCurve: false
property bool zoomHeight: false
property int delegateIndex: -1
signal clicked()

Expand Down Expand Up @@ -208,11 +209,15 @@ Rectangle {
focusPolicy: Qt.NoFocus
visible: delegateIndex >= 0 && paramHeadRoot.isCurve
checkable: true
checked: zoomHeight
action: Action {
id: zoomFitKeyframeAction
icon.name: 'zoom-fit-best'
icon.source: 'qrc:///icons/oxygen/32x32/actions/zoom-fit-best.png'
onTriggered: root.paramRepeater.itemAt(delegateIndex).zoomHeight = checked
onTriggered: {
zoomHeight = !zoomHeight
root.paramRepeater.itemAt(delegateIndex).setLowestHighest(zoomHeight)
}
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/qml/views/keyframes/keyframes.qml
Expand Up @@ -541,9 +541,8 @@ Rectangle {
rootIndex: parameterDelegateModel.modelIndex(index)
width: producer.duration * timeScale
isCurve: model.isCurve
property bool zoomHeight: false
minimum: zoomHeight ? model.lowest : model.minimum
maximum: zoomHeight ? model.highest : model.maximum
minimum: model.minimum
maximum: model.maximum
height: Logic.trackHeight(model.isCurve)
onClicked: {
currentTrack = parameter.DelegateModel.itemsIndex
Expand Down