| 1 |
/* |
| 2 |
* Audacity: A Digital Audio Editor |
| 3 |
*/ |
| 4 |
import QtQuick |
| 5 |
import QtQuick.Layouts |
| 6 |
|
| 7 |
import Muse.Ui |
| 8 |
import Muse.UiComponents |
| 9 |
|
| 10 |
StyledPopupView { |
| 11 |
id: root |
| 12 |
|
| 13 |
property int upper: 0 |
| 14 |
property int lower: 0 |
| 15 |
|
| 16 |
signal upperChangeRequested(var newValue) |
| 17 |
signal lowerChangeRequested(var newValue) |
| 18 |
|
| 19 |
margins: 12 |
| 20 |
|
| 21 |
contentWidth: 216 |
| 22 |
contentHeight: 52 |
| 23 |
|
| 24 |
ColumnLayout { |
| 25 |
id: content |
| 26 |
|
| 27 |
anchors.fill: parent |
| 28 |
|
| 29 |
spacing: 8 |
| 30 |
|
| 31 |
StyledTextLabel { |
| 32 |
Layout.fillWidth: true |
| 33 |
|
| 34 |
text: qsTrc("playback", "Time signature") |
| 35 |
horizontalAlignment: Text.AlignLeft |
| 36 |
} |
| 37 |
|
| 38 |
Row { |
| 39 |
spacing: 12 |
| 40 |
|
| 41 |
IncrementalPropertyControl { |
| 42 |
id: control |
| 43 |
|
| 44 |
implicitWidth: 80 |
| 45 |
anchors.verticalCenter: parent.verticalCenter |
| 46 |
|
| 47 |
currentValue: root.upper |
| 48 |
step: 1 |
| 49 |
decimals: 0 |
| 50 |
maxValue: 128 |
| 51 |
minValue: 1 |
| 52 |
|
| 53 |
onValueEdited: function(newValue) { |
| 54 |
root.upperChangeRequested(newValue) |
| 55 |
} |
| 56 |
} |
| 57 |
|
| 58 |
StyledTextLabel { |
| 59 |
width: 8 |
| 60 |
anchors.verticalCenter: parent.verticalCenter |
| 61 |
font: ui.theme.largeBodyFont |
| 62 |
text: "/" |
| 63 |
} |
| 64 |
|
| 65 |
StyledDropdown { |
| 66 |
id: timeComboBox |
| 67 |
|
| 68 |
width: control.width |
| 69 |
anchors.verticalCenter: parent.verticalCenter |
| 70 |
|
| 71 |
currentIndex: timeComboBox.indexOfValue(root.lower) |
| 72 |
|
| 73 |
model: [ |
| 74 |
{ "text": "2", "value": 2 }, |
| 75 |
{ "text": "4", "value": 4 }, |
| 76 |
{ "text": "8", "value": 8 }, |
| 77 |
{ "text": "16", "value": 16 }, |
| 78 |
{ "text": "32", "value": 32 }, |
| 79 |
{ "text": "64", "value": 64 } |
| 80 |
] |
| 81 |
|
| 82 |
onActivated: function(index, value) { |
| 83 |
root.lowerChangeRequested(value) |
| 84 |
} |
| 85 |
} |
| 86 |
} |
| 87 |
} |
| 88 |
} |