@@ -43,13 +43,14 @@ PreferencesPage {
4343 id: percussionPanelPreferences
4444
4545 title: qsTrc (" appshell/preferences" , " Percussion" )
46+ rowSpacing: 20
4647
4748 navigation .section : root .navigationSection
4849
4950 CheckBox {
5051 id: unpitchedSelectedCheckbox
5152
52- visible : percussionPreferencesModel .useNewPercussionPanel
53+ enabled : percussionPreferencesModel .useNewPercussionPanel
5354 width: parent .width
5455
5556 text: qsTrc (" appshell/preferences" , " Open the percussion panel when an unpitched staff is selected" )
@@ -65,109 +66,138 @@ PreferencesPage {
6566 }
6667 }
6768
68- StyledTextLabel {
69- id: padSwapInfo
69+ Column {
70+ id: swappingOptionsColumn
7071
71- visible: percussionPreferencesModel .useNewPercussionPanel
7272 width: parent .width
73+ spacing: 12
7374
74- horizontalAlignment: Text .AlignLeft
75- wrapMode: Text .Wrap
76- text: qsTrc (" notation/percussion" , " When swapping the positions of two drum pads:" )
77- }
78-
79- RadioButtonGroup {
80- id: radioButtons
75+ StyledTextLabel {
76+ id: padSwapInfo
8177
82- property int navigationRowStart : unpitchedSelectedCheckbox . navigation . row + 1
83- property int navigationRowEnd : radioButtons . navigationRowStart + model . length
78+ enabled : percussionPreferencesModel . useNewPercussionPanel
79+ width : parent . width
8480
85- visible: percussionPreferencesModel .useNewPercussionPanel
81+ horizontalAlignment: Text .AlignLeft
82+ wrapMode: Text .Wrap
83+ text: qsTrc (" notation/percussion" , " When swapping the positions of two drum pads:" )
84+ }
8685
87- width : parent . width
88- spacing : percussionPanelPreferences . spacing
86+ RadioButtonGroup {
87+ id : radioButtons
8988
90- orientation: ListView .Vertical
89+ property int navigationRowStart: unpitchedSelectedCheckbox .navigation .row + 1
90+ property int navigationRowEnd: radioButtons .navigationRowStart + model .length
9191
92- model: [
93- { text: qsTrc (" notation/percussion" , " Move MIDI notes and keyboard shortcuts with their sounds" ), value: true },
94- { text: qsTrc (" notation/percussion" , " Leave MIDI notes and keyboard shortcuts fixed to original pad positions" ), value: false }
95- ]
92+ enabled: percussionPreferencesModel .useNewPercussionPanel
9693
97- delegate: Row {
9894 width: parent .width
99- spacing: 6
95+ spacing: swappingOptionsColumn .spacing
96+
97+ orientation: ListView .Vertical
98+
99+ model: [
100+ { text: qsTrc (" notation/percussion" , " Move MIDI notes and keyboard shortcuts with their sounds" ), value: true },
101+ { text: qsTrc (" notation/percussion" , " Leave MIDI notes and keyboard shortcuts fixed to original pad positions" ), value: false }
102+ ]
103+
104+ delegate: Row {
105+ width: parent .width
106+ spacing: 6
100107
101- RoundedRadioButton {
102- id: radioButton
108+ RoundedRadioButton {
109+ id: radioButton
103110
104- anchors .verticalCenter : parent .verticalCenter
111+ anchors .verticalCenter : parent .verticalCenter
105112
106- navigation .name : modelData .text
107- navigation .panel : percussionPanelPreferences .navigation
108- navigation .row : radioButtons .navigationRowStart + model .index
113+ navigation .name : modelData .text
114+ navigation .panel : percussionPanelPreferences .navigation
115+ navigation .row : radioButtons .navigationRowStart + model .index
109116
110- checked: modelData .value === percussionPreferencesModel .percussionPanelMoveMidiNotesAndShortcuts
117+ checked: modelData .value === percussionPreferencesModel .percussionPanelMoveMidiNotesAndShortcuts
111118
112- onToggled: {
113- percussionPreferencesModel .percussionPanelMoveMidiNotesAndShortcuts = modelData .value
119+ onToggled: {
120+ percussionPreferencesModel .percussionPanelMoveMidiNotesAndShortcuts = modelData .value
121+ }
114122 }
115- }
116123
117- // ! NOTE: Can't use radioButton.text because it won't wrap
118- StyledTextLabel {
119- width: parent .width - parent .spacing - radioButton .width
124+ // ! NOTE: Can't use radioButton.text because it won't wrap
125+ StyledTextLabel {
126+ width: parent .width - parent .spacing - radioButton .width
120127
121- anchors .verticalCenter : parent .verticalCenter
128+ anchors .verticalCenter : parent .verticalCenter
122129
123- horizontalAlignment: Text .AlignLeft
124- wrapMode: Text .Wrap
125- text: modelData .text
130+ horizontalAlignment: Text .AlignLeft
131+ wrapMode: Text .Wrap
132+ text: modelData .text
126133
127- MouseArea {
128- id: mouseArea
134+ MouseArea {
135+ id: mouseArea
129136
130- anchors .fill : parent
137+ anchors .fill : parent
131138
132- onClicked: {
133- percussionPreferencesModel .percussionPanelMoveMidiNotesAndShortcuts = modelData .value
139+ onClicked: {
140+ percussionPreferencesModel .percussionPanelMoveMidiNotesAndShortcuts = modelData .value
141+ }
134142 }
135143 }
136144 }
137145 }
146+
147+ CheckBox {
148+ id: alwaysAsk
149+
150+ enabled: percussionPreferencesModel .useNewPercussionPanel
151+ width: parent .width
152+
153+ text: qsTrc (" global" , " Always ask" )
154+
155+ navigation .name : " AlwaysAskCheckBox"
156+ navigation .panel : percussionPanelPreferences .navigation
157+ navigation .row : radioButtons .navigationRowEnd
158+
159+ checked: percussionPreferencesModel .showPercussionPanelPadSwapDialog
160+
161+ onClicked: {
162+ percussionPreferencesModel .showPercussionPanelPadSwapDialog = ! alwaysAsk .checked
163+ }
164+ }
138165 }
139166
140- CheckBox {
141- id: alwaysAsk
167+ Row {
168+ id: useLegacyToggleRow
142169
143- visible : percussionPreferencesModel . useNewPercussionPanel
170+ height : useLegacyToggle . height
144171 width: parent .width
145172
146- text : qsTrc ( " global " , " Always ask " )
173+ spacing : 6
147174
148- navigation .name : " AlwaysAskCheckBox"
149- navigation .panel : percussionPanelPreferences .navigation
150- navigation .row : radioButtons .navigationRowEnd
175+ ToggleButton {
176+ id: useLegacyToggle
151177
152- checked: percussionPreferencesModel .showPercussionPanelPadSwapDialog
178+ checked: ! percussionPreferencesModel .useNewPercussionPanel
153179
154- onClicked: {
155- percussionPreferencesModel .showPercussionPanelPadSwapDialog = ! alwaysAsk .checked
180+ navigation .name : " UseLegacyPercussionPanel"
181+ navigation .panel : percussionPanelPreferences .navigation
182+ navigation .row : alwaysAsk .navigation .row + 1
183+
184+ onToggled: {
185+ percussionPreferencesModel .useNewPercussionPanel = ! percussionPreferencesModel .useNewPercussionPanel
186+ }
156187 }
157- }
158188
159- FlatButton {
160- id: useNewPercussionPanel
189+ StyledTextLabel {
190+ id: legacyToggleInfo
161191
162- text: percussionPreferencesModel .useNewPercussionPanel ? qsTrc (" notation/percussion" , " Switch to old percussion panel" )
163- : qsTrc (" notation/percussion" , " Switch to new percussion panel" )
192+ enabled: percussionPreferencesModel .useNewPercussionPanel
164193
165- navigation .name : " SwitchPercussionPanels"
166- navigation .panel : percussionPanelPreferences .navigation
167- navigation .row : alwaysAsk .navigation .row + 1
194+ height: parent .height
195+
196+ horizontalAlignment: Text .AlignLeft
197+ verticalAlignment: Text .AlignVCenter
168198
169- onClicked : {
170- percussionPreferencesModel . useNewPercussionPanel = ! percussionPreferencesModel . useNewPercussionPanel
199+ wrapMode : Text . Wrap
200+ text : qsTrc ( " notation/percussion " , " Use legacy percussion panel " )
171201 }
172202 }
173203 }
0 commit comments