| 1 |
/* |
| 2 |
* Audacity: A Digital Audio Editor |
| 3 |
*/ |
| 4 |
import QtQuick |
| 5 |
import QtQuick.Controls |
| 6 |
import QtQuick.Layouts |
| 7 |
|
| 8 |
import Muse.Ui |
| 9 |
import Muse.UiComponents |
| 10 |
|
| 11 |
import "../components" |
| 12 |
import "internal" |
| 13 |
|
| 14 |
RowLayout { |
| 15 |
id: root |
| 16 |
|
| 17 |
property alias upper: upperLabel.text |
| 18 |
property alias lower: lowerLabel.text |
| 19 |
|
| 20 |
signal upperChangeRequested(var newValue) |
| 21 |
signal lowerChangeRequested(var newValue) |
| 22 |
|
| 23 |
height: 28 |
| 24 |
|
| 25 |
spacing: 1 |
| 26 |
|
| 27 |
RoundedRectangle { |
| 28 |
Layout.preferredWidth: childrenRect.width |
| 29 |
Layout.fillHeight: true |
| 30 |
|
| 31 |
topLeftRadius: 3 |
| 32 |
bottomLeftRadius: 3 |
| 33 |
|
| 34 |
color: ui.theme.backgroundQuarternaryColor |
| 35 |
|
| 36 |
Item { |
| 37 |
property int margin: 10 |
| 38 |
|
| 39 |
width: row.width + margin * 2 |
| 40 |
height: row.height |
| 41 |
|
| 42 |
Row { |
| 43 |
id: row |
| 44 |
|
| 45 |
anchors.left: parent.left |
| 46 |
anchors.leftMargin: parent.margin |
| 47 |
anchors.verticalCenter: parent.verticalCenter |
| 48 |
|
| 49 |
height: root.height |
| 50 |
|
| 51 |
spacing: 6 |
| 52 |
|
| 53 |
StyledTextLabel { |
| 54 |
id: upperLabel |
| 55 |
|
| 56 |
anchors.verticalCenter: parent.verticalCenter |
| 57 |
|
| 58 |
font: ui.theme.tabBoldFont |
| 59 |
color: ui.theme.fontSecondaryColor |
| 60 |
} |
| 61 |
|
| 62 |
StyledTextLabel { |
| 63 |
anchors.verticalCenter: parent.verticalCenter |
| 64 |
|
| 65 |
text: "/" |
| 66 |
opacity: 0.75 |
| 67 |
font: ui.theme.tabBoldFont |
| 68 |
color: ui.theme.fontSecondaryColor |
| 69 |
} |
| 70 |
|
| 71 |
StyledTextLabel { |
| 72 |
id: lowerLabel |
| 73 |
|
| 74 |
anchors.verticalCenter: parent.verticalCenter |
| 75 |
|
| 76 |
font: ui.theme.tabBoldFont |
| 77 |
color: ui.theme.fontSecondaryColor |
| 78 |
} |
| 79 |
} |
| 80 |
} |
| 81 |
} |
| 82 |
|
| 83 |
ArrowButton { |
| 84 |
id: popupBtn |
| 85 |
|
| 86 |
Layout.preferredWidth: 16 |
| 87 |
Layout.fillHeight: true |
| 88 |
|
| 89 |
function togglePopupOpened() { |
| 90 |
if (popup.isOpened) { |
| 91 |
popup.close() |
| 92 |
} else { |
| 93 |
popup.open() |
| 94 |
} |
| 95 |
} |
| 96 |
|
| 97 |
onClicked: function(mouse) { |
| 98 |
togglePopupOpened() |
| 99 |
} |
| 100 |
|
| 101 |
TimeSignaturePopup { |
| 102 |
id: popup |
| 103 |
|
| 104 |
upper: root.upper |
| 105 |
lower: root.lower |
| 106 |
|
| 107 |
onUpperChangeRequested: function(newValue){ |
| 108 |
root.upperChangeRequested(newValue) |
| 109 |
} |
| 110 |
|
| 111 |
onLowerChangeRequested: function(newValue){ |
| 112 |
root.lowerChangeRequested(newValue) |
| 113 |
} |
| 114 |
} |
| 115 |
} |
| 116 |
} |