| 1 |
/* |
| 2 |
* Audacity: A Digital Audio Editor |
| 3 |
*/ |
| 4 |
import QtQuick |
| 5 |
import QtQuick.Layouts |
| 6 |
|
| 7 |
import Muse.UiComponents |
| 8 |
|
| 9 |
import Audacity.ProjectScene |
| 10 |
|
| 11 |
RowLayout { |
| 12 |
id: root |
| 13 |
|
| 14 |
property bool isSnapEnabled: false |
| 15 |
|
| 16 |
property string currentSnapMode: "" |
| 17 |
property var contextMenuModel: null |
| 18 |
|
| 19 |
spacing: 6 |
| 20 |
|
| 21 |
signal snapEnableChangeRequested(var snap) |
| 22 |
signal handleMenuItem(var itemId) |
| 23 |
|
| 24 |
StyledTextLabel { |
| 25 |
Layout.alignment: Qt.AlignVCenter |
| 26 |
|
| 27 |
text: qsTrc("projectscene", "Snap") |
| 28 |
} |
| 29 |
|
| 30 |
CheckBox { |
| 31 |
id: snapCheckBox |
| 32 |
|
| 33 |
Layout.alignment: Qt.AlignVCenter |
| 34 |
|
| 35 |
checked: root.isSnapEnabled |
| 36 |
|
| 37 |
onClicked: function() { |
| 38 |
root.snapEnableChangeRequested(!snapCheckBox.checked) |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
SnapChooseItem { |
| 43 |
Layout.fillWidth: true |
| 44 |
Layout.fillHeight: true |
| 45 |
|
| 46 |
text: root.currentSnapMode |
| 47 |
|
| 48 |
contextMenuModel: root.contextMenuModel |
| 49 |
|
| 50 |
onHandleMenuItem: function(itemId) { |
| 51 |
root.handleMenuItem(itemId) |
| 52 |
} |
| 53 |
} |
| 54 |
} |