Skip to content

Commit 0bee621

Browse files
committed
Support MusicTimeOffset
1 parent 41e6e1a commit 0bee621

File tree

5 files changed

+51
-7
lines changed

5 files changed

+51
-7
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import QtQml
2+
import QtQuick
3+
import QtQuick.Controls
4+
import QtQuick.Layouts
5+
6+
import SVSCraft
7+
import SVSCraft.UIComponents
8+
9+
import DiffScope.UIShell
10+
11+
AbstractPropertyEditorField {
12+
id: d
13+
property int from: 0
14+
property int to: 2147483647
15+
readonly property MusicTimeOffsetSpinBox spinBox: control
16+
FormGroup {
17+
Layout.fillWidth: true
18+
label: d.label
19+
columnItem: MusicTimeOffsetSpinBox {
20+
id: control
21+
value: d.value ?? 0
22+
from: d.from
23+
to: d.to
24+
contentItem.visible: d.value !== undefined
25+
onValueModified: () => {
26+
if (!helper.buttonPressed) {
27+
d.beginTransaction()
28+
}
29+
if (!d.transactionId)
30+
return
31+
d.propertyMapper[d.key] = value
32+
if (!helper.buttonPressed) {
33+
d.commitTransaction()
34+
}
35+
}
36+
SpinBoxPressedHelper {
37+
id: helper
38+
spinBox: control
39+
onPressed: d.beginTransaction()
40+
onReleased: d.commitTransaction()
41+
}
42+
}
43+
}
44+
}

src/plugins/coreplugin/qml/dialogs/InsertSingingClipDialog.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Dialog {
6767
id: lengthLabel
6868
text: qsTr("Length")
6969
}
70-
SpinBox {
70+
MusicTimeOffsetSpinBox {
7171
id: lengthSpinBox
7272
Accessible.labelledBy: lengthLabel
7373
Accessible.name: lengthLabel.text

src/plugins/coreplugin/qml/propertyeditors/ClipTimePropertyEditor.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ PropertyEditorGroupBox {
2323
label: qsTr("Position")
2424
transactionName: qsTr("Editing clip position")
2525
}
26-
IntegerPropertyEditorField {
26+
MusicTimeOffsetPropertyEditorField {
2727
windowHandle: groupBox.windowHandle
2828
propertyMapper: groupBox.propertyMapper
2929
key: "startingOffset"
3030
label: qsTr("Starting offset")
3131
to: ((groupBox.propertyMapper?.fullLength ?? 0) === 0 ? 2147483647 : groupBox.propertyMapper.fullLength) - (groupBox.propertyMapper?.clipLength ?? 0)
3232
transactionName: qsTr("Editing clip starting offset")
3333
}
34-
IntegerPropertyEditorField {
34+
MusicTimeOffsetPropertyEditorField {
3535
windowHandle: groupBox.windowHandle
3636
propertyMapper: groupBox.propertyMapper
3737
key: "clipLength"

src/plugins/coreplugin/qml/propertyeditors/NoteTimePropertyEditor.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ PropertyEditorGroupBox {
1717
ColumnLayout {
1818
width: parent.width
1919

20-
MusicTimePropertyEditorField {
20+
MusicTimeOffsetPropertyEditorField {
2121
windowHandle: groupBox.windowHandle
2222
propertyMapper: groupBox.propertyMapper
2323
key: "pos"
24-
label: qsTr("Onset position")
24+
label: qsTr("Onset position (relative to clip)")
2525
transactionName: qsTr("Editing onset position")
2626
}
2727

28-
IntegerPropertyEditorField {
28+
MusicTimeOffsetPropertyEditorField {
2929
windowHandle: groupBox.windowHandle
3030
propertyMapper: groupBox.propertyMapper
3131
key: "length"

0 commit comments

Comments
 (0)