-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
174 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
src/notation/qml/MuseScore/NotationScene/internal/EditStyle/StyleControlRowWithReset.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
* MuseScore-CLA-applies | ||
* | ||
* MuseScore | ||
* Music Composition & Notation | ||
* | ||
* Copyright (C) 2021 MuseScore BVBA and others | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import QtQuick 2.15 | ||
import QtQuick.Layouts 1.15 | ||
|
||
import MuseScore.NotationScene 1.0 | ||
import Muse.UiComponents 1.0 | ||
import Muse.Ui 1.0 | ||
|
||
RowLayout { | ||
id: root | ||
required property StyleItem styleItem | ||
required property string label | ||
readonly property double maxLabelWidth: 120 | ||
readonly property double maxControlWidth: 326 | ||
|
||
property double labelWidth: maxLabelWidth | ||
property double controlWidth: maxControlWidth | ||
|
||
default property alias data: control.data | ||
|
||
property bool hasReset: true | ||
|
||
StyledTextLabel { | ||
id: optionLabel | ||
horizontalAlignment: Text.AlignLeft | ||
Layout.fillWidth: true | ||
Layout.maximumWidth: Math.min(root.labelWidth, root.maxLabelWidth) | ||
wrapMode: Text.WordWrap | ||
text: label | ||
} | ||
|
||
Item { | ||
id: control | ||
Layout.preferredWidth: Math.min(root.controlWidth, root.maxControlWidth) | ||
Layout.alignment: Qt.AlignTop | ||
} | ||
|
||
Item { | ||
Layout.preferredWidth: Math.max(root.maxControlWidth - control.width - root.spacing - 1, 0) | ||
} | ||
|
||
FlatButton { | ||
id: resetButton | ||
visible: hasReset | ||
icon: IconCode.UNDO | ||
enabled: !styleItem.isDefault | ||
onClicked: styleItem.value = styleItem.defaultValue | ||
} | ||
} |
Oops, something went wrong.