|
| 1 | +//============================================== |
| 2 | +// Cautionary Accidentals v4.0 |
| 3 | +// https://github.com/XiaoMigros/Cautionary-Accidentals |
| 4 | +// Copyright (C)2023 XiaoMigros |
| 5 | +// |
| 6 | +// This program is free software: you can redistribute it and/or modify |
| 7 | +// it under the terms of the GNU General Public License as published by |
| 8 | +// the Free Software Foundation, either version 3 of the License, or |
| 9 | +// (at your option) any later version. |
| 10 | +// |
| 11 | +// This program is distributed in the hope that it will be useful, |
| 12 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +// GNU General Public License for more details. |
| 15 | +// |
| 16 | +// You should have received a copy of the GNU General Public License |
| 17 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | +//============================================== |
| 19 | + |
| 20 | +import QtQuick 2.9 |
| 21 | +import QtQuick.Layouts 1.2 |
| 22 | +import MuseScore.Ui 1.0 |
| 23 | +import MuseScore.UiComponents 1.0 as MU |
| 24 | + |
| 25 | +Item { |
| 26 | + id: root |
| 27 | + |
| 28 | + height: bracketBox.height //childrenRect.height |
| 29 | + //requires indicated width |
| 30 | + |
| 31 | + property alias checked: checkBox.checked |
| 32 | + property alias currentValue: bracketBox.currentValue |
| 33 | + |
| 34 | + signal clicked |
| 35 | + signal setv(bool checked, int value) |
| 36 | + |
| 37 | + MU.CheckBox { |
| 38 | + id: checkBox |
| 39 | + anchors.left: parent.left |
| 40 | + anchors.verticalCenter: parent.verticalCenter |
| 41 | + text: qsTr("Add Courtesy Accidentals") |
| 42 | + onClicked: {checked = !checked; root.clicked()} |
| 43 | + signal setv(bool checked) |
| 44 | + onSetv: function(value) {checked = value; root.clicked()} |
| 45 | + } |
| 46 | + BracketBox { |
| 47 | + id: bracketBox |
| 48 | + anchors.right: parent.right |
| 49 | + anchors.verticalCenter: parent.verticalCenter |
| 50 | + enabled: checkBox.checked |
| 51 | + onActivated: root.clicked() |
| 52 | + } |
| 53 | + onSetv: function(checked, value) { |
| 54 | + checkBox.setv(checked) |
| 55 | + bracketBox.setv(value) |
| 56 | + } |
| 57 | +} |
0 commit comments