-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
EditPage.qml
71 lines (64 loc) · 2.24 KB
/
EditPage.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.12
import org.kde.kirigami 2.10 as Kirigami
import org.kde.rattlesnake 1.0
Kirigami.ScrollablePage {
title: qsTr("Edit beat")
mainAction: Kirigami.Action {
icon.name: "list-add"
onTriggered: Metronome.addNote(0)
}
Kirigami.CardsListView {
model: Metronome.notes
delegate: Kirigami.Card {
actions: [
Kirigami.Action {
visible: index > 0
text: "Delete"
icon.name: "delete"
onTriggered: Metronome.removeNote(index)
}
]
contentItem: Item {
implicitWidth: delegateLayout.implicitWidth
implicitHeight: delegateLayout.implicitHeight
ColumnLayout {
id: delegateLayout
anchors.fill: parent
ButtonGroup {
buttons: column.children
}
RowLayout {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
Layout.fillHeight: true
id: column
InstrumentButton {
belongsToIndex: index
instrument: Metronome.Click
}
InstrumentButton {
belongsToIndex: index
instrument: Metronome.HighHead
}
InstrumentButton {
belongsToIndex: index
instrument: Metronome.Snare
}
}
Slider {
Layout.alignment: Qt.AlignHCenter
from: 0
to: 100
snapMode: Slider.SnapAlways
stepSize: 10
value: Metronome.notes[index].volume
onMoved: Metronome.notes[index].volume = value
}
}
}
}
}
}