From c342e03749e436c3a619c8637c3ad3f513ae2083 Mon Sep 17 00:00:00 2001 From: Eism Date: Wed, 15 Sep 2021 15:16:02 +0200 Subject: [PATCH 01/12] Simplified the canvas page --- src/appshell/appshell.qrc | 2 + .../qml/Preferences/CanvasPreferencesPage.qml | 132 +++--------------- .../internal/ScrollPagesSection.qml | 85 +++++++++++ .../qml/Preferences/internal/ZoomSection.qml | 98 +++++++++++++ .../Shortcuts/MidiDeviceMappingPage.qml | 2 + 5 files changed, 205 insertions(+), 114 deletions(-) create mode 100644 src/appshell/qml/Preferences/internal/ScrollPagesSection.qml create mode 100644 src/appshell/qml/Preferences/internal/ZoomSection.qml diff --git a/src/appshell/appshell.qrc b/src/appshell/appshell.qrc index a9fe87d104..f73fb83290 100644 --- a/src/appshell/appshell.qrc +++ b/src/appshell/appshell.qrc @@ -86,5 +86,7 @@ qml/Preferences/internal/FoldersSection.qml qml/Preferences/internal/ResetThemeButtonSection.qml qml/Preferences/internal/AdvancedTopSection.qml + qml/Preferences/internal/ZoomSection.qml + qml/Preferences/internal/ScrollPagesSection.qml diff --git a/src/appshell/qml/Preferences/CanvasPreferencesPage.qml b/src/appshell/qml/Preferences/CanvasPreferencesPage.qml index 43167e2466..f75cda45f1 100644 --- a/src/appshell/qml/Preferences/CanvasPreferencesPage.qml +++ b/src/appshell/qml/Preferences/CanvasPreferencesPage.qml @@ -43,132 +43,36 @@ PreferencesPage { anchors.fill: parent spacing: 24 - Column { - anchors.left: parent.left - anchors.right: parent.right - spacing: 18 + ZoomSection { + defaultZoom: preferencesModel.defaultZoom + zoomTypes: preferencesModel.zoomTypes() + mouseZoomPrecision: preferencesModel.mouseZoomPrecision - StyledTextLabel { - text: qsTrc("appshell", "Zoom") - font: ui.theme.bodyBoldFont + onDefaultZoomTypeChangeRequested: { + preferencesModel.setDefaultZoomType(zoomType) } - Column { - spacing: 8 + onDefaultZoomLevelChangeRequested: { + preferencesModel.setDefaultZoomLevel(zoomLevel) + } - Row { - spacing: 12 - - ComboBoxWithTitle { - title: qsTrc("appshell", "Default zoom:") - titleWidth: 210 - - control.textRole: "title" - control.valueRole: "value" - - currentIndex: control.indexOfValue(preferencesModel.defaultZoom.type) - - model: preferencesModel.zoomTypes() - - onValueEdited: { - preferencesModel.setDefaultZoomType(newValue) - } - } - - IncrementalPropertyControl { - id: defaultZoomControl - width: 64 - - maxValue: 1600 - minValue: 10 - step: 10 - decimals: 0 - - measureUnitsSymbol: "%" - - currentValue: preferencesModel.defaultZoom.level - enabled: preferencesModel.defaultZoom.isPercentage - - onValueEdited: { - preferencesModel.setDefaultZoomLevel(newValue) - } - } - } - - IncrementalPropertyControlWithTitle { - title: qsTrc("appshell", "Mouse zoom precision:") - - titleWidth: 208 - control.width: 60 - - minValue: 1 - maxValue: 16 - currentValue: preferencesModel.mouseZoomPrecision - - onValueEdited: { - preferencesModel.mouseZoomPrecision = newValue - } - } + onMouseZoomPrecisionChangeRequested: { + preferencesModel.mouseZoomPrecision = zoomPrecision } } SeparatorLine { } - Column { - anchors.left: parent.left - anchors.right: parent.right - spacing: 18 + ScrollPagesSection { + orientation: preferencesModel.scrollPagesOrientation + limitScrollArea: preferencesModel.limitScrollArea - StyledTextLabel { - text: qsTrc("appshell", "Scroll pages") - font: ui.theme.bodyBoldFont + onOrientationChangeRequested: { + preferencesModel.scrollPagesOrientation = orientation } - Column { - spacing: 16 - - RadioButtonGroup { - id: radioButtonList - - width: 100 - height: implicitHeight - - spacing: 12 - orientation: ListView.Vertical - - model: [ - { title: qsTrc("appshell", "Horizontal"), value: Qt.Horizontal }, - { title: qsTrc("appshell", "Vertical"), value: Qt.Vertical } - ] - - delegate: RoundedRadioButton { - width: parent.width - leftPadding: 0 - spacing: 6 - - ButtonGroup.group: radioButtonList.radioButtonGroup - - checked: preferencesModel.scrollPagesOrientation === modelData["value"] - - StyledTextLabel { - text: modelData["title"] - horizontalAlignment: Text.AlignLeft - } - - onToggled: { - preferencesModel.scrollPagesOrientation = modelData["value"] - } - } - } - - CheckBox { - text: qsTrc("appshell", "Limit scroll area to page borders") - checked: preferencesModel.limitScrollArea - - onClicked: { - preferencesModel.limitScrollArea = !preferencesModel.limitScrollArea - } - } + onLimitScrollAreaChangeRequested: { + preferencesModel.limitScrollArea = limit } } } diff --git a/src/appshell/qml/Preferences/internal/ScrollPagesSection.qml b/src/appshell/qml/Preferences/internal/ScrollPagesSection.qml new file mode 100644 index 0000000000..3c4a3e939e --- /dev/null +++ b/src/appshell/qml/Preferences/internal/ScrollPagesSection.qml @@ -0,0 +1,85 @@ +/* + * 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 . + */ +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +import MuseScore.UiComponents 1.0 + +BaseSection { + id: root + + title: qsTrc("appshell", "Scroll pages") + + property int orientation: Qt.Horizontal + property alias limitScrollArea: limitScrollAreaBox.checked + + signal orientationChangeRequested(int orientation) + signal limitScrollAreaChangeRequested(bool limit) + + Column { + spacing: 16 + + RadioButtonGroup { + id: radioButtonList + + width: 100 + height: implicitHeight + + spacing: 12 + orientation: ListView.Vertical + + model: [ + { title: qsTrc("appshell", "Horizontal"), value: Qt.Horizontal }, + { title: qsTrc("appshell", "Vertical"), value: Qt.Vertical } + ] + + delegate: RoundedRadioButton { + width: parent.width + leftPadding: 0 + spacing: 6 + + ButtonGroup.group: radioButtonList.radioButtonGroup + + checked: root.orientation === modelData["value"] + + StyledTextLabel { + text: modelData["title"] + horizontalAlignment: Text.AlignLeft + } + + onToggled: { + root.orientationChangeRequested(modelData["value"]) + } + } + } + + CheckBox { + id: limitScrollAreaBox + + text: qsTrc("appshell", "Limit scroll area to page borders") + + onClicked: { + root.limitScrollAreaChangeRequested(!checked) + } + } + } +} diff --git a/src/appshell/qml/Preferences/internal/ZoomSection.qml b/src/appshell/qml/Preferences/internal/ZoomSection.qml new file mode 100644 index 0000000000..cd71fd3897 --- /dev/null +++ b/src/appshell/qml/Preferences/internal/ZoomSection.qml @@ -0,0 +1,98 @@ +/* + * 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 . + */ +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +import MuseScore.UiComponents 1.0 + +BaseSection { + id: root + + title: qsTrc("appshell", "Zoom") + + property var defaultZoom: null + property alias zoomTypes: defaultZoomTypesBox.model + property alias mouseZoomPrecision: mouseZoomPrecisionControl.currentValue + + signal defaultZoomTypeChangeRequested(int zoomType) + signal defaultZoomLevelChangeRequested(int zoomLevel) + signal mouseZoomPrecisionChangeRequested(int zoomPrecision) + + Column { + spacing: 8 + + Row { + spacing: 12 + + ComboBoxWithTitle { + id: defaultZoomTypesBox + + title: qsTrc("appshell", "Default zoom:") + titleWidth: 210 + + control.textRole: "title" + control.valueRole: "value" + + currentIndex: control.indexOfValue(root.defaultZoom.type) + + onValueEdited: { + root.defaultZoomTypeChangeRequested(newValue) + } + } + + IncrementalPropertyControl { + id: defaultZoomControl + width: 64 + + maxValue: 1600 + minValue: 10 + step: 10 + decimals: 0 + + measureUnitsSymbol: "%" + + currentValue: root.defaultZoom.level + enabled: root.defaultZoom.isPercentage + + onValueEdited: { + root.defaultZoomLevelChangeRequested(newValue) + } + } + } + + IncrementalPropertyControlWithTitle { + id: mouseZoomPrecisionControl + + title: qsTrc("appshell", "Mouse zoom precision:") + + titleWidth: 208 + control.width: 60 + + minValue: 1 + maxValue: 16 + + onValueEdited: { + root.mouseZoomPrecisionChangeRequested(newValue) + } + } + } +} diff --git a/src/framework/shortcuts/qml/MuseScore/Shortcuts/MidiDeviceMappingPage.qml b/src/framework/shortcuts/qml/MuseScore/Shortcuts/MidiDeviceMappingPage.qml index 3fff3aaca0..8b6cda7fb0 100644 --- a/src/framework/shortcuts/qml/MuseScore/Shortcuts/MidiDeviceMappingPage.qml +++ b/src/framework/shortcuts/qml/MuseScore/Shortcuts/MidiDeviceMappingPage.qml @@ -69,6 +69,8 @@ Item { spacing: 20 MidiMappingTopPanel { + useRemoteControl: mappingsModel.useRemoteControl + navigation.section: root.navigationSection navigation.order: root.navigationOrderStart + 1 From a818743d0f67b837e5973feff135bb6f4e7bcb34 Mon Sep 17 00:00:00 2001 From: Eism Date: Wed, 15 Sep 2021 15:54:15 +0200 Subject: [PATCH 02/12] Implemented accessibility for canvas page --- .../qml/Preferences/CanvasPreferencesPage.qml | 6 ++++++ .../internal/AccentColorsSection.qml | 2 +- .../internal/ColorAndWallpaperSection.qml | 4 ++-- .../internal/ProgrammeStartSection.qml | 2 +- .../internal/ScrollPagesSection.qml | 10 ++++++++++ .../qml/Preferences/internal/ThemesSection.qml | 2 +- .../qml/Preferences/internal/ZoomSection.qml | 18 ++++++++++++++++++ .../UiComponents/RoundedRadioButton.qml | 8 ++------ 8 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/appshell/qml/Preferences/CanvasPreferencesPage.qml b/src/appshell/qml/Preferences/CanvasPreferencesPage.qml index f75cda45f1..29eef0005b 100644 --- a/src/appshell/qml/Preferences/CanvasPreferencesPage.qml +++ b/src/appshell/qml/Preferences/CanvasPreferencesPage.qml @@ -48,6 +48,9 @@ PreferencesPage { zoomTypes: preferencesModel.zoomTypes() mouseZoomPrecision: preferencesModel.mouseZoomPrecision + navigation.section: root.navigationSection + navigation.order: root.navigationOrderStart + 1 + onDefaultZoomTypeChangeRequested: { preferencesModel.setDefaultZoomType(zoomType) } @@ -67,6 +70,9 @@ PreferencesPage { orientation: preferencesModel.scrollPagesOrientation limitScrollArea: preferencesModel.limitScrollArea + navigation.section: root.navigationSection + navigation.order: root.navigationOrderStart + 2 + onOrientationChangeRequested: { preferencesModel.scrollPagesOrientation = orientation } diff --git a/src/appshell/qml/Preferences/internal/AccentColorsSection.qml b/src/appshell/qml/Preferences/internal/AccentColorsSection.qml index c6398aef76..c6ca9d5ba7 100644 --- a/src/appshell/qml/Preferences/internal/AccentColorsSection.qml +++ b/src/appshell/qml/Preferences/internal/AccentColorsSection.qml @@ -81,7 +81,7 @@ Row { navigation.column: model.index navigation.accessible.name: Utils.colorToString(accentColor) - onClicked: { + onToggled: { root.accentColorChangeRequested(model.index) } diff --git a/src/appshell/qml/Preferences/internal/ColorAndWallpaperSection.qml b/src/appshell/qml/Preferences/internal/ColorAndWallpaperSection.qml index 0a2f09421d..ad45d41a44 100644 --- a/src/appshell/qml/Preferences/internal/ColorAndWallpaperSection.qml +++ b/src/appshell/qml/Preferences/internal/ColorAndWallpaperSection.qml @@ -68,7 +68,7 @@ BaseSection { navigation.row: 0 navigation.column: 0 - onClicked: { + onToggled: { root.useColorChangeRequested(true) } } @@ -101,7 +101,7 @@ BaseSection { navigation.row: 1 navigation.column: 0 - onClicked: { + onToggled: { root.useColorChangeRequested(false) } } diff --git a/src/appshell/qml/Preferences/internal/ProgrammeStartSection.qml b/src/appshell/qml/Preferences/internal/ProgrammeStartSection.qml index 31c25e2a91..d3cb645d9f 100644 --- a/src/appshell/qml/Preferences/internal/ProgrammeStartSection.qml +++ b/src/appshell/qml/Preferences/internal/ProgrammeStartSection.qml @@ -64,7 +64,7 @@ BaseSection { navigation.row: model.index navigation.column: 0 - onClicked: { + onToggled: { root.currentStartupModesChanged(model.index) } } diff --git a/src/appshell/qml/Preferences/internal/ScrollPagesSection.qml b/src/appshell/qml/Preferences/internal/ScrollPagesSection.qml index 3c4a3e939e..96132e7138 100644 --- a/src/appshell/qml/Preferences/internal/ScrollPagesSection.qml +++ b/src/appshell/qml/Preferences/internal/ScrollPagesSection.qml @@ -61,7 +61,13 @@ BaseSection { checked: root.orientation === modelData["value"] + navigation.name: "ScrollPagesOrientationButton" + navigation.panel: root.navigation + navigation.row: model.index + navigation.accessible.name: titleLabel.text + StyledTextLabel { + id: titleLabel text: modelData["title"] horizontalAlignment: Text.AlignLeft } @@ -77,6 +83,10 @@ BaseSection { text: qsTrc("appshell", "Limit scroll area to page borders") + navigation.name: "LimitScrollAreaBox" + navigation.panel: root.navigation + navigation.row: radioButtonList.model.length + onClicked: { root.limitScrollAreaChangeRequested(!checked) } diff --git a/src/appshell/qml/Preferences/internal/ThemesSection.qml b/src/appshell/qml/Preferences/internal/ThemesSection.qml index 5529d061ca..747dde3687 100644 --- a/src/appshell/qml/Preferences/internal/ThemesSection.qml +++ b/src/appshell/qml/Preferences/internal/ThemesSection.qml @@ -104,7 +104,7 @@ BaseSection { navigation.row: 1 navigation.column: index - onClicked: { + onToggled: { root.themeChangeRequested(modelData.codeKey) } } diff --git a/src/appshell/qml/Preferences/internal/ZoomSection.qml b/src/appshell/qml/Preferences/internal/ZoomSection.qml index cd71fd3897..55007ea3ca 100644 --- a/src/appshell/qml/Preferences/internal/ZoomSection.qml +++ b/src/appshell/qml/Preferences/internal/ZoomSection.qml @@ -22,6 +22,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 +import MuseScore.Ui 1.0 import MuseScore.UiComponents 1.0 BaseSection { @@ -29,6 +30,8 @@ BaseSection { title: qsTrc("appshell", "Zoom") + navigation.direction: NavigationPanel.Both + property var defaultZoom: null property alias zoomTypes: defaultZoomTypesBox.model property alias mouseZoomPrecision: mouseZoomPrecisionControl.currentValue @@ -54,6 +57,11 @@ BaseSection { currentIndex: control.indexOfValue(root.defaultZoom.type) + navigation.name: "DefaultZoomBox" + navigation.panel: root.navigation + navigation.row: 0 + navigation.column: 0 + onValueEdited: { root.defaultZoomTypeChangeRequested(newValue) } @@ -73,6 +81,11 @@ BaseSection { currentValue: root.defaultZoom.level enabled: root.defaultZoom.isPercentage + navigation.name: "DefaultZoomControl" + navigation.panel: root.navigation + navigation.row: 0 + navigation.column: 1 + onValueEdited: { root.defaultZoomLevelChangeRequested(newValue) } @@ -90,6 +103,11 @@ BaseSection { minValue: 1 maxValue: 16 + navigation.name: "MouseZoomPercisionControl" + navigation.panel: root.navigation + navigation.row: 1 + navigation.column: 0 + onValueEdited: { root.mouseZoomPrecisionChangeRequested(newValue) } diff --git a/src/framework/uicomponents/qml/MuseScore/UiComponents/RoundedRadioButton.qml b/src/framework/uicomponents/qml/MuseScore/UiComponents/RoundedRadioButton.qml index f13961f78a..d3f2bd47e9 100644 --- a/src/framework/uicomponents/qml/MuseScore/UiComponents/RoundedRadioButton.qml +++ b/src/framework/uicomponents/qml/MuseScore/UiComponents/RoundedRadioButton.qml @@ -59,7 +59,7 @@ RadioDelegate { } } - onTriggered: root.clicked() + onTriggered: root.toggled() } contentItem: Item { @@ -119,11 +119,7 @@ RadioDelegate { } } - background: Rectangle { - anchors.fill: parent - - color: ui.theme.backgroundSecondaryColor - } + background: { } states: [ State { From 53c935356ca08dc15613b41144ba35ba054200b2 Mon Sep 17 00:00:00 2001 From: Eism Date: Wed, 15 Sep 2021 17:13:45 +0200 Subject: [PATCH 03/12] Fixed appearance page --- src/appshell/appshell.qrc | 2 +- .../Preferences/AppearancePreferencesPage.qml | 21 ++++++++--------- ....qml => ThemeAdditionalOptionsSection.qml} | 23 +++++++++++++++---- .../UiComponents/RoundedRadioButton.qml | 2 +- 4 files changed, 30 insertions(+), 18 deletions(-) rename src/appshell/qml/Preferences/internal/{ResetThemeButtonSection.qml => ThemeAdditionalOptionsSection.qml} (67%) diff --git a/src/appshell/appshell.qrc b/src/appshell/appshell.qrc index f73fb83290..f36aa852fa 100644 --- a/src/appshell/appshell.qrc +++ b/src/appshell/appshell.qrc @@ -84,7 +84,7 @@ qml/Preferences/internal/RemoteControlSection.qml qml/Preferences/internal/ProgrammeStartSection.qml qml/Preferences/internal/FoldersSection.qml - qml/Preferences/internal/ResetThemeButtonSection.qml + qml/Preferences/internal/ThemeAdditionalOptionsSection.qml qml/Preferences/internal/AdvancedTopSection.qml qml/Preferences/internal/ZoomSection.qml qml/Preferences/internal/ScrollPagesSection.qml diff --git a/src/appshell/qml/Preferences/AppearancePreferencesPage.qml b/src/appshell/qml/Preferences/AppearancePreferencesPage.qml index 7f07984c30..e6e6be2811 100644 --- a/src/appshell/qml/Preferences/AppearancePreferencesPage.qml +++ b/src/appshell/qml/Preferences/AppearancePreferencesPage.qml @@ -171,17 +171,6 @@ PreferencesPage { SeparatorLine {} - CheckBox { - id: scoreInversionEnable - - checked: appearanceModel.scoreInversionEnabled - text: qsTrc("appshell", "Invert score colors") - - onClicked: { - appearanceModel.scoreInversionEnabled = !checked - } - } - ColorAndWallpaperSection { id: paperSettings @@ -220,7 +209,11 @@ PreferencesPage { } } - ResetThemeButtonSection { + SeparatorLine {} + + ThemeAdditionalOptionsSection { + scoreInversionEnabled: appearanceModel.scoreInversionEnabled + navigation.section: root.navigationSection navigation.order: root.navigationOrderStart + 7 @@ -233,6 +226,10 @@ PreferencesPage { root.ensureContentVisibleRequested(Qt.rect(x, y, width, height)) } } + + onScoreInversionEnableChangeRequested: { + appearanceModel.scoreInversionEnabled = enable + } } } } diff --git a/src/appshell/qml/Preferences/internal/ResetThemeButtonSection.qml b/src/appshell/qml/Preferences/internal/ThemeAdditionalOptionsSection.qml similarity index 67% rename from src/appshell/qml/Preferences/internal/ResetThemeButtonSection.qml rename to src/appshell/qml/Preferences/internal/ThemeAdditionalOptionsSection.qml index 69052efa54..73829d5e54 100644 --- a/src/appshell/qml/Preferences/internal/ResetThemeButtonSection.qml +++ b/src/appshell/qml/Preferences/internal/ThemeAdditionalOptionsSection.qml @@ -21,21 +21,36 @@ */ import QtQuick 2.15 -import MuseScore.Ui 1.0 import MuseScore.UiComponents 1.0 -import MuseScore.Preferences 1.0 BaseSection { id: root + property alias scoreInversionEnabled: scoreInversionEnable.checked + signal resetThemeToDefaultRequested() + signal scoreInversionEnableChangeRequested(bool enable) + + CheckBox { + id: scoreInversionEnable + + text: qsTrc("appshell", "Invert score") + + navigation.name: "ScoreInversionBox" + navigation.panel: root.navigation + navigation.row: 0 + + onClicked: { + root.scoreInversionEnableChangeRequested(!checked) + } + } FlatButton { - text: qsTrc("appshell", "Reset theme to default") + text: qsTrc("appshell", "Reset to default") navigation.name: "ResetButton" navigation.panel: root.navigation - navigation.order: 1 + navigation.row: 1 onClicked: { root.resetThemeToDefaultRequested() diff --git a/src/framework/uicomponents/qml/MuseScore/UiComponents/RoundedRadioButton.qml b/src/framework/uicomponents/qml/MuseScore/UiComponents/RoundedRadioButton.qml index d3f2bd47e9..9ccae457bc 100644 --- a/src/framework/uicomponents/qml/MuseScore/UiComponents/RoundedRadioButton.qml +++ b/src/framework/uicomponents/qml/MuseScore/UiComponents/RoundedRadioButton.qml @@ -119,7 +119,7 @@ RadioDelegate { } } - background: { } + background: Item { } states: [ State { From 702f59f4aeb35e8a95769fc00155059b742552e9 Mon Sep 17 00:00:00 2001 From: Eism Date: Wed, 15 Sep 2021 17:15:34 +0200 Subject: [PATCH 04/12] Simplified the note inpput page --- src/appshell/appshell.qrc | 2 + .../Preferences/NoteInputPreferencesPage.qml | 92 ++++++------------- .../internal/NoteInputPlaySection.qml | 87 ++++++++++++++++++ .../Preferences/internal/NoteInputSection.qml | 76 +++++++++++++++ .../internal/ScrollPagesSection.qml | 7 +- 5 files changed, 195 insertions(+), 69 deletions(-) create mode 100644 src/appshell/qml/Preferences/internal/NoteInputPlaySection.qml create mode 100644 src/appshell/qml/Preferences/internal/NoteInputSection.qml diff --git a/src/appshell/appshell.qrc b/src/appshell/appshell.qrc index f36aa852fa..7bd74ba4be 100644 --- a/src/appshell/appshell.qrc +++ b/src/appshell/appshell.qrc @@ -88,5 +88,7 @@ qml/Preferences/internal/AdvancedTopSection.qml qml/Preferences/internal/ZoomSection.qml qml/Preferences/internal/ScrollPagesSection.qml + qml/Preferences/internal/NoteInputSection.qml + qml/Preferences/internal/NoteInputPlaySection.qml diff --git a/src/appshell/qml/Preferences/NoteInputPreferencesPage.qml b/src/appshell/qml/Preferences/NoteInputPreferencesPage.qml index 876d11c19e..03d66b95ec 100644 --- a/src/appshell/qml/Preferences/NoteInputPreferencesPage.qml +++ b/src/appshell/qml/Preferences/NoteInputPreferencesPage.qml @@ -40,91 +40,51 @@ PreferencesPage { spacing: 22 - StyledTextLabel { - text: qsTrc("appshell", "Note input") - font: ui.theme.bodyBoldFont - } + NoteInputSection { + advanceToNextNote: noteInputModel.advanceToNextNoteOnKeyRelease + colorNotes: noteInputModel.colorNotesOusideOfUsablePitchRange - CheckBox { - text: qsTrc("appshell", "Advance to next note on key release (MIDI)") + navigation.section: root.navigationSection + navigation.order: root.navigationOrderStart + 1 - checked: noteInputModel.advanceToNextNoteOnKeyRelease - - onClicked: { - noteInputModel.advanceToNextNoteOnKeyRelease = !checked + onAdvanceToNextNoteChangeRequested: { + noteInputModel.advanceToNextNoteOnKeyRelease = advance } - } - CheckBox { - width: 170 - text: qsTrc("appshell", "Colour notes outside of usable pitch range") - - checked: noteInputModel.colorNotesOusideOfUsablePitchRange - - onClicked: { - noteInputModel.colorNotesOusideOfUsablePitchRange = !checked + onColorNotesChangeRequested: { + noteInputModel.colorNotesOusideOfUsablePitchRange = color } - } - IncrementalPropertyControlWithTitle { - title: qsTrc("appshell", "Delay between notes in automatic real time mode:") - - titleWidth: 173 - spacing: 46 - - currentValue: noteInputModel.delayBetweenNotesInRealTimeModeMilliseconds - measureUnitsSymbol: qsTrc("appshell", "ms") - - onValueEdited: { - noteInputModel.delayBetweenNotesInRealTimeModeMilliseconds = newValue + onDelayBetweenNotesChangeRequested: { + noteInputModel.delayBetweenNotesInRealTimeModeMilliseconds = delay } } SeparatorLine {} - CheckBox { - text: qsTrc("appshell", "Play notes when editing") - font: ui.theme.bodyBoldFont + NoteInputPlaySection { + playNotesWhenEditing: noteInputModel.playNotesWhenEditing + playChordWhenEditing: noteInputModel.playChordWhenEditing + playChordSymbolWhenEditing: noteInputModel.playChordSymbolWhenEditing + notePlayDurationMilliseconds: noteInputModel.notePlayDurationMilliseconds - checked: noteInputModel.playNotesWhenEditing + navigation.section: root.navigationSection + navigation.order: root.navigationOrderStart + 2 - onClicked: { - noteInputModel.playNotesWhenEditing = !checked + onPlayNotesWhenEditingChangeRequested: { + noteInputModel.playChordWhenEditing = play } - } - IncrementalPropertyControlWithTitle { - title: qsTrc("appshell", "Default duration:") - - spacing: 126 - - currentValue: noteInputModel.notePlayDurationMilliseconds - measureUnitsSymbol: qsTrc("appshell", "ms") - - onValueEdited: { - noteInputModel.notePlayDurationMilliseconds = newValue + onPlayChordWhenEditingChangeRequested: { + noteInputModel.playChordWhenEditing = play } - } - CheckBox { - text: qsTrc("appshell", "Play chord when editing") - - checked: noteInputModel.playChordWhenEditing - enabled: noteInputModel.playNotesWhenEditing - - onClicked: { - noteInputModel.playChordWhenEditing = !checked + onPlayChordSymbolWhenEditingChangeRequested: { + noteInputModel.playChordSymbolWhenEditing = play } - } - CheckBox { - text: qsTrc("appshell", "Play chord symbol when editing") - - checked: noteInputModel.playChordSymbolWhenEditing - enabled: noteInputModel.playNotesWhenEditing - - onClicked: { - noteInputModel.playChordSymbolWhenEditing = !checked + onNotePlayDurationChangeRequested: { + noteInputModel.notePlayDurationMilliseconds = duration } } } diff --git a/src/appshell/qml/Preferences/internal/NoteInputPlaySection.qml b/src/appshell/qml/Preferences/internal/NoteInputPlaySection.qml new file mode 100644 index 0000000000..70f92fb13d --- /dev/null +++ b/src/appshell/qml/Preferences/internal/NoteInputPlaySection.qml @@ -0,0 +1,87 @@ +/* + * 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 . + */ +import QtQuick 2.15 + +import MuseScore.UiComponents 1.0 + +BaseSection { + id: root + + property alias playNotesWhenEditing: playNotesBox.checked + property alias playChordWhenEditing: playChordBox.checked + property alias playChordSymbolWhenEditing: playChordSymbolBox.checked + property alias notePlayDurationMilliseconds: notePlayDurationControl.currentValue + + signal playNotesWhenEditingChangeRequested(bool play) + signal playChordWhenEditingChangeRequested(bool play) + signal playChordSymbolWhenEditingChangeRequested(bool play) + signal notePlayDurationChangeRequested(int duration) + + CheckBox { + id: playNotesBox + + text: qsTrc("appshell", "Play notes when editing") + font: ui.theme.bodyBoldFont + + onClicked: { + root.playNotesWhenEditingChangeRequested(!checked) + } + } + + IncrementalPropertyControlWithTitle { + id: notePlayDurationControl + + title: qsTrc("appshell", "Default duration:") + + spacing: 126 + + measureUnitsSymbol: qsTrc("appshell", "ms") + + onValueEdited: { + root.notePlayDurationChangeRequested(newValue) + } + } + + CheckBox { + id: playChordBox + + text: qsTrc("appshell", "Play chord when editing") + + enabled: root.playNotesWhenEditing + + onClicked: { + root.playChordWhenEditingChangeRequested(!checked) + } + } + + CheckBox { + id: playChordSymbolBox + + text: qsTrc("appshell", "Play chord symbol when editing") + + enabled: root.playNotesWhenEditing + + onClicked: { + root.playChordSymbolWhenEditingChangeRequested(!checked) + } + } +} diff --git a/src/appshell/qml/Preferences/internal/NoteInputSection.qml b/src/appshell/qml/Preferences/internal/NoteInputSection.qml new file mode 100644 index 0000000000..f2b3564e57 --- /dev/null +++ b/src/appshell/qml/Preferences/internal/NoteInputSection.qml @@ -0,0 +1,76 @@ +/* + * 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 . + */ +import QtQuick 2.15 +import QtQuick.Layouts 1.15 + +import MuseScore.Ui 1.0 +import MuseScore.UiComponents 1.0 + +BaseSection { + id: root + + title: qsTrc("appshell", "Note input") + + property alias advanceToNextNote: advanceToNextNoteBox.checked + property alias colorNotes: colorNotesBox.checked + property alias delayBetweenNotes: delayBetweenNotesControl.currentValue + + signal advanceToNextNoteChangeRequested(bool advance) + signal colorNotesChangeRequested(bool color) + signal delayBetweenNotesChangeRequested(int delay) + + CheckBox { + id: advanceToNextNoteBox + + text: qsTrc("appshell", "Advance to next note on key release (MIDI)") + + onClicked: { + root.advanceToNextNoteOnKeyReleaseChangeRequested(!checked) + } + } + + CheckBox { + id: colorNotesBox + + width: 170 + text: qsTrc("appshell", "Colour notes outside of usable pitch range") + + onClicked: { + root.colorNotesOusideOfUsablePitchRangeChangeRequested(!checked) + } + } + + IncrementalPropertyControlWithTitle { + id: delayBetweenNotesControl + + title: qsTrc("appshell", "Delay between notes in automatic real time mode:") + + titleWidth: 173 + spacing: 46 + + measureUnitsSymbol: qsTrc("appshell", "ms") + + onValueEdited: { + root.delayBetweenNotesChangeRequested(newValue) + } + } +} diff --git a/src/appshell/qml/Preferences/internal/ScrollPagesSection.qml b/src/appshell/qml/Preferences/internal/ScrollPagesSection.qml index 96132e7138..50d99c5d71 100644 --- a/src/appshell/qml/Preferences/internal/ScrollPagesSection.qml +++ b/src/appshell/qml/Preferences/internal/ScrollPagesSection.qml @@ -57,6 +57,8 @@ BaseSection { leftPadding: 0 spacing: 6 + property string title: modelData["title"] + ButtonGroup.group: radioButtonList.radioButtonGroup checked: root.orientation === modelData["value"] @@ -64,11 +66,10 @@ BaseSection { navigation.name: "ScrollPagesOrientationButton" navigation.panel: root.navigation navigation.row: model.index - navigation.accessible.name: titleLabel.text + navigation.accessible.name: title StyledTextLabel { - id: titleLabel - text: modelData["title"] + text: title horizontalAlignment: Text.AlignLeft } From 0a2ed2203d3b27e6e1db2e8a59110055550c930c Mon Sep 17 00:00:00 2001 From: Eism Date: Wed, 15 Sep 2021 17:47:24 +0200 Subject: [PATCH 05/12] Fixed accessible checked state for check box --- src/framework/accessibility/iaccessible.h | 3 ++- .../accessibility/internal/accessibleiteminterface.cpp | 9 ++++++++- src/framework/ui/view/qmlaccessible.h | 1 + .../uicomponents/qml/MuseScore/UiComponents/CheckBox.qml | 1 + .../qml/MuseScore/UiComponents/FlatRadioButton.qml | 2 +- .../qml/MuseScore/UiComponents/GradientTabButton.qml | 2 +- .../qml/MuseScore/UiComponents/RoundedRadioButton.qml | 2 +- .../qml/MuseScore/UiComponents/StyledTabButton.qml | 2 +- 8 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/framework/accessibility/iaccessible.h b/src/framework/accessibility/iaccessible.h index a79593dd56..3a5df5e8de 100644 --- a/src/framework/accessibility/iaccessible.h +++ b/src/framework/accessibility/iaccessible.h @@ -63,7 +63,8 @@ public: Enabled, Active, Focused, - Selected + Selected, + Checked }; enum class Property { diff --git a/src/framework/accessibility/internal/accessibleiteminterface.cpp b/src/framework/accessibility/internal/accessibleiteminterface.cpp index 24b0a028ff..b450b25466 100644 --- a/src/framework/accessibility/internal/accessibleiteminterface.cpp +++ b/src/framework/accessibility/internal/accessibleiteminterface.cpp @@ -141,7 +141,7 @@ QAccessible::State AccessibleItemInterface::state() const state.focused = item->accessibleState(IAccessible::State::Focused); state.checkable = true; - state.checked = item->accessibleState(IAccessible::State::Selected); + state.checked = item->accessibleState(IAccessible::State::Checked); } break; case IAccessible::Role::EditableText: { state.focusable = true; @@ -166,6 +166,13 @@ QAccessible::State AccessibleItemInterface::state() const // state.checkable = true; // state.checked = item->accessibleState(IAccessible::State::Selected); } break; + case IAccessible::Role::CheckBox: { + state.focusable = true; + state.focused = item->accessibleState(IAccessible::State::Focused); + + state.checkable = true; + state.checked = item->accessibleState(IAccessible::State::Checked); + } break; default: { LOGW() << "not handled role: " << static_cast(r); } break; diff --git a/src/framework/ui/view/qmlaccessible.h b/src/framework/ui/view/qmlaccessible.h index 25a446ced4..aa72885238 100644 --- a/src/framework/ui/view/qmlaccessible.h +++ b/src/framework/ui/view/qmlaccessible.h @@ -82,6 +82,7 @@ public: STATE_PROPERTY(selected, State::Selected) STATE_PROPERTY(focused, State::Focused) + STATE_PROPERTY(checked, State::Checked) AccessibleItem(QObject* parent = nullptr); ~AccessibleItem(); diff --git a/src/framework/uicomponents/qml/MuseScore/UiComponents/CheckBox.qml b/src/framework/uicomponents/qml/MuseScore/UiComponents/CheckBox.qml index 8a4209d68b..ab95221177 100644 --- a/src/framework/uicomponents/qml/MuseScore/UiComponents/CheckBox.qml +++ b/src/framework/uicomponents/qml/MuseScore/UiComponents/CheckBox.qml @@ -55,6 +55,7 @@ FocusScope { enabled: root.enabled accessible.role: MUAccessible.CheckBox accessible.name: root.text + accessible.checked: root.checked onActiveChanged: { if (!root.activeFocus) { diff --git a/src/framework/uicomponents/qml/MuseScore/UiComponents/FlatRadioButton.qml b/src/framework/uicomponents/qml/MuseScore/UiComponents/FlatRadioButton.qml index eac2587a18..d73f1b77f1 100644 --- a/src/framework/uicomponents/qml/MuseScore/UiComponents/FlatRadioButton.qml +++ b/src/framework/uicomponents/qml/MuseScore/UiComponents/FlatRadioButton.qml @@ -62,7 +62,7 @@ RadioDelegate { accessible.role: MUAccessible.RadioButton accessible.name: root.text - accessible.selected: root.checked + accessible.checked: root.checked onTriggered: root.checked = !root.checked } diff --git a/src/framework/uicomponents/qml/MuseScore/UiComponents/GradientTabButton.qml b/src/framework/uicomponents/qml/MuseScore/UiComponents/GradientTabButton.qml index c0a6d09a37..93b332daaf 100644 --- a/src/framework/uicomponents/qml/MuseScore/UiComponents/GradientTabButton.qml +++ b/src/framework/uicomponents/qml/MuseScore/UiComponents/GradientTabButton.qml @@ -55,7 +55,7 @@ RadioDelegate { accessible.role: MUAccessible.RadioButton accessible.name: root.title - accessible.selected: root.checked + accessible.checked: root.checked onActiveChanged: { if (keynavCtrl.active) { diff --git a/src/framework/uicomponents/qml/MuseScore/UiComponents/RoundedRadioButton.qml b/src/framework/uicomponents/qml/MuseScore/UiComponents/RoundedRadioButton.qml index 9ccae457bc..94a6b121cd 100644 --- a/src/framework/uicomponents/qml/MuseScore/UiComponents/RoundedRadioButton.qml +++ b/src/framework/uicomponents/qml/MuseScore/UiComponents/RoundedRadioButton.qml @@ -51,7 +51,7 @@ RadioDelegate { accessible.role: MUAccessible.RadioButton accessible.name: root.text - accessible.selected: root.checked + accessible.checked: root.checked onActiveChanged: { if (keynavCtrl.active) { diff --git a/src/framework/uicomponents/qml/MuseScore/UiComponents/StyledTabButton.qml b/src/framework/uicomponents/qml/MuseScore/UiComponents/StyledTabButton.qml index ed0c60439c..a1d425fff9 100644 --- a/src/framework/uicomponents/qml/MuseScore/UiComponents/StyledTabButton.qml +++ b/src/framework/uicomponents/qml/MuseScore/UiComponents/StyledTabButton.qml @@ -60,7 +60,7 @@ TabButton { accessible.role: MUAccessible.RadioButton accessible.name: root.text - accessible.selected: root.isCurrent + accessible.checked: root.isCurrent onActiveChanged: { if (active) { From 6a9e06186948e0d96b9e20434c1b2d49ea451a35 Mon Sep 17 00:00:00 2001 From: Eism Date: Wed, 15 Sep 2021 17:48:11 +0200 Subject: [PATCH 06/12] Implemented accessibility for note input page --- .../Preferences/NoteInputPreferencesPage.qml | 1 + .../IncrementalPropertyControlWithTitle.qml | 2 +- .../internal/NoteInputPlaySection.qml | 17 +++++++++++++++++ .../Preferences/internal/NoteInputSection.qml | 12 ++++++++++++ .../MuseScore/UiComponents/TextInputField.qml | 2 +- 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/appshell/qml/Preferences/NoteInputPreferencesPage.qml b/src/appshell/qml/Preferences/NoteInputPreferencesPage.qml index 03d66b95ec..2c324ce90c 100644 --- a/src/appshell/qml/Preferences/NoteInputPreferencesPage.qml +++ b/src/appshell/qml/Preferences/NoteInputPreferencesPage.qml @@ -43,6 +43,7 @@ PreferencesPage { NoteInputSection { advanceToNextNote: noteInputModel.advanceToNextNoteOnKeyRelease colorNotes: noteInputModel.colorNotesOusideOfUsablePitchRange + delayBetweenNotes: noteInputModel.delayBetweenNotesInRealTimeModeMilliseconds navigation.section: root.navigationSection navigation.order: root.navigationOrderStart + 1 diff --git a/src/appshell/qml/Preferences/internal/IncrementalPropertyControlWithTitle.qml b/src/appshell/qml/Preferences/internal/IncrementalPropertyControlWithTitle.qml index 365fcd38df..fa29f8df31 100644 --- a/src/appshell/qml/Preferences/internal/IncrementalPropertyControlWithTitle.qml +++ b/src/appshell/qml/Preferences/internal/IncrementalPropertyControlWithTitle.qml @@ -60,7 +60,7 @@ Row { decimals: 0 step: 1 - navigation.accessible.name: titleLabel.text + " " + currentValue + navigation.accessible.name: titleLabel.text + " " + currentValue + " " + measureUnitsSymbol onValueEdited: { root.valueEdited(newValue) diff --git a/src/appshell/qml/Preferences/internal/NoteInputPlaySection.qml b/src/appshell/qml/Preferences/internal/NoteInputPlaySection.qml index 70f92fb13d..20bf002d6d 100644 --- a/src/appshell/qml/Preferences/internal/NoteInputPlaySection.qml +++ b/src/appshell/qml/Preferences/internal/NoteInputPlaySection.qml @@ -21,6 +21,7 @@ */ import QtQuick 2.15 +import MuseScore.Ui 1.0 import MuseScore.UiComponents 1.0 BaseSection { @@ -42,6 +43,10 @@ BaseSection { text: qsTrc("appshell", "Play notes when editing") font: ui.theme.bodyBoldFont + navigation.name: "PlayNotesBox" + navigation.panel: root.navigation + navigation.row: 0 + onClicked: { root.playNotesWhenEditingChangeRequested(!checked) } @@ -56,6 +61,10 @@ BaseSection { measureUnitsSymbol: qsTrc("appshell", "ms") + navigation.name: "NotePlayDurationControl" + navigation.panel: root.navigation + navigation.row: 1 + onValueEdited: { root.notePlayDurationChangeRequested(newValue) } @@ -68,6 +77,10 @@ BaseSection { enabled: root.playNotesWhenEditing + navigation.name: "PlayChordBox" + navigation.panel: root.navigation + navigation.row: 2 + onClicked: { root.playChordWhenEditingChangeRequested(!checked) } @@ -80,6 +93,10 @@ BaseSection { enabled: root.playNotesWhenEditing + navigation.name: "PlayChordSymbolBox" + navigation.panel: root.navigation + navigation.row: 3 + onClicked: { root.playChordSymbolWhenEditingChangeRequested(!checked) } diff --git a/src/appshell/qml/Preferences/internal/NoteInputSection.qml b/src/appshell/qml/Preferences/internal/NoteInputSection.qml index f2b3564e57..c5a8159bff 100644 --- a/src/appshell/qml/Preferences/internal/NoteInputSection.qml +++ b/src/appshell/qml/Preferences/internal/NoteInputSection.qml @@ -43,6 +43,10 @@ BaseSection { text: qsTrc("appshell", "Advance to next note on key release (MIDI)") + navigation.name: "AdvanceToNextNoteBox" + navigation.panel: root.navigation + navigation.row: 0 + onClicked: { root.advanceToNextNoteOnKeyReleaseChangeRequested(!checked) } @@ -54,6 +58,10 @@ BaseSection { width: 170 text: qsTrc("appshell", "Colour notes outside of usable pitch range") + navigation.name: "ColorNotesBox" + navigation.panel: root.navigation + navigation.row: 1 + onClicked: { root.colorNotesOusideOfUsablePitchRangeChangeRequested(!checked) } @@ -69,6 +77,10 @@ BaseSection { measureUnitsSymbol: qsTrc("appshell", "ms") + navigation.name: "DelayBetweenNotesControl" + navigation.panel: root.navigation + navigation.row: 2 + onValueEdited: { root.delayBetweenNotesChangeRequested(newValue) } diff --git a/src/framework/uicomponents/qml/MuseScore/UiComponents/TextInputField.qml b/src/framework/uicomponents/qml/MuseScore/UiComponents/TextInputField.qml index c06f26b645..1e2ab8a60c 100644 --- a/src/framework/uicomponents/qml/MuseScore/UiComponents/TextInputField.qml +++ b/src/framework/uicomponents/qml/MuseScore/UiComponents/TextInputField.qml @@ -88,7 +88,7 @@ FocusScope { enabled: root.enabled && root.visible accessible.role: MUAccessible.EditableText - accessible.name: Boolean(valueInput.text) ? valueInput.text : valueInput.placeholderText + accessible.name: Boolean(valueInput.text) ? valueInput.text + " " + measureUnitsLabel.text : valueInput.placeholderText accessible.visualItem: root onActiveChanged: { From 4737903bc245e35476a57c60578c9817a99b4914 Mon Sep 17 00:00:00 2001 From: Eism Date: Wed, 15 Sep 2021 18:15:49 +0200 Subject: [PATCH 07/12] Simplified the score page --- src/appshell/appshell.qrc | 2 + .../qml/Preferences/ScorePreferencesPage.qml | 79 +++---------------- .../internal/DefaultFilesSection.qml | 72 +++++++++++++++++ .../Preferences/internal/ScoreViewSection.qml | 45 +++++++++++ .../preferences/scorepreferencesmodel.cpp | 16 ++-- .../view/preferences/scorepreferencesmodel.h | 6 +- 6 files changed, 143 insertions(+), 77 deletions(-) create mode 100644 src/appshell/qml/Preferences/internal/DefaultFilesSection.qml create mode 100644 src/appshell/qml/Preferences/internal/ScoreViewSection.qml diff --git a/src/appshell/appshell.qrc b/src/appshell/appshell.qrc index 7bd74ba4be..a40564963d 100644 --- a/src/appshell/appshell.qrc +++ b/src/appshell/appshell.qrc @@ -90,5 +90,7 @@ qml/Preferences/internal/ScrollPagesSection.qml qml/Preferences/internal/NoteInputSection.qml qml/Preferences/internal/NoteInputPlaySection.qml + qml/Preferences/internal/DefaultFilesSection.qml + qml/Preferences/internal/ScoreViewSection.qml diff --git a/src/appshell/qml/Preferences/ScorePreferencesPage.qml b/src/appshell/qml/Preferences/ScorePreferencesPage.qml index cdd9ea7050..fde1367ce5 100644 --- a/src/appshell/qml/Preferences/ScorePreferencesPage.qml +++ b/src/appshell/qml/Preferences/ScorePreferencesPage.qml @@ -25,6 +25,8 @@ import QtQuick.Layouts 1.15 import MuseScore.UiComponents 1.0 import MuseScore.Preferences 1.0 +import "internal" + PreferencesPage { id: root @@ -39,81 +41,22 @@ PreferencesPage { } Column { - anchors.fill: parent + id: content + + width: parent.width spacing: 24 - Column { - id: content - anchors.left: parent.left - anchors.right: parent.right - spacing: 18 - - StyledTextLabel { - text: qsTrc("appshell", "Default files") - font: ui.theme.bodyBoldFont - } - - ListView { - anchors.left: parent.left - anchors.right: parent.right - - height: contentHeight - - spacing: 4 - - model: scorePreferencesModel - - delegate: RowLayout { - width: ListView.view.width - height: 30 - - spacing: 20 - - StyledTextLabel { - Layout.alignment: Qt.AlignLeft - - text: model.title + ":" - } - - FilePicker { - Layout.alignment: Qt.AlignRight - Layout.preferredWidth: 380 - - dialogTitle: model.chooseTitle - filter: model.pathFilter - dir: scorePreferencesModel.fileDirectory(model.path) - - path: model.path - - onPathEdited: { - model.path = newPath - } - } - } - } + DefaultFilesSection { + model: scorePreferencesModel } SeparatorLine { } - Column { - anchors.left: parent.left - anchors.right: parent.right - spacing: 18 + ScoreViewSection { + isShowMIDIControls: scorePreferencesModel.isShowMIDIControls - StyledTextLabel { - text: qsTrc("appshell", "View") - font: ui.theme.bodyBoldFont - } - - CheckBox { - width: 216 - text: qsTrc("appshell", "Show MIDI controls in mixer") - - checked: scorePreferencesModel.isShowMIDIControls - - onClicked: { - scorePreferencesModel.isShowMIDIControls = !scorePreferencesModel.isShowMIDIControls - } + onShowMIDIControlsChangeRequested: { + scorePreferencesModel.isShowMIDIControls = show } } } diff --git a/src/appshell/qml/Preferences/internal/DefaultFilesSection.qml b/src/appshell/qml/Preferences/internal/DefaultFilesSection.qml new file mode 100644 index 0000000000..28c12354a9 --- /dev/null +++ b/src/appshell/qml/Preferences/internal/DefaultFilesSection.qml @@ -0,0 +1,72 @@ +/* + * 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 . + */ +import QtQuick 2.15 +import QtQuick.Layouts 1.15 + +import MuseScore.UiComponents 1.0 + +BaseSection { + id: root + + title: qsTrc("appshell", "Default files") + + property alias model: view.model + + ListView { + id: view + + anchors.left: parent.left + anchors.right: parent.right + + height: contentHeight + + spacing: 4 + + delegate: RowLayout { + width: ListView.view.width + height: 30 + + spacing: 20 + + StyledTextLabel { + Layout.alignment: Qt.AlignLeft + + text: model.title + ":" + } + + FilePicker { + Layout.alignment: Qt.AlignRight + Layout.preferredWidth: 380 + + dialogTitle: model.chooseTitle + filter: model.pathFilter + dir: model.directory + + path: model.path + + onPathEdited: { + model.path = newPath + } + } + } + } +} diff --git a/src/appshell/qml/Preferences/internal/ScoreViewSection.qml b/src/appshell/qml/Preferences/internal/ScoreViewSection.qml new file mode 100644 index 0000000000..8e229c2385 --- /dev/null +++ b/src/appshell/qml/Preferences/internal/ScoreViewSection.qml @@ -0,0 +1,45 @@ +/* + * 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 . + */ +import QtQuick 2.15 + +import MuseScore.UiComponents 1.0 + +BaseSection { + id: root + + title: qsTrc("appshell", "View") + + property alias isShowMIDIControls: isShowMIDIControlsBox.checked + + signal showMIDIControlsChangeRequested(bool show) + + CheckBox { + id: isShowMIDIControlsBox + + width: 216 + text: qsTrc("appshell", "Show MIDI controls in mixer") + + onClicked: { + root.showMIDIControlsChangeRequested(!checked) + } + } +} diff --git a/src/appshell/view/preferences/scorepreferencesmodel.cpp b/src/appshell/view/preferences/scorepreferencesmodel.cpp index 00cd369f30..ac7af4682b 100644 --- a/src/appshell/view/preferences/scorepreferencesmodel.cpp +++ b/src/appshell/view/preferences/scorepreferencesmodel.cpp @@ -44,6 +44,7 @@ QVariant ScorePreferencesModel::data(const QModelIndex& index, int role) const case PathRole: return file.path; case PathFilterRole: return file.pathFilter; case ChooseTitleRole: return file.chooseTitle; + case DirectoryRole: return fileDirectory(file.path); } return QVariant(); @@ -75,7 +76,8 @@ QHash ScorePreferencesModel::roleNames() const { TitleRole, "title" }, { PathRole, "path" }, { PathFilterRole, "pathFilter" }, - { ChooseTitleRole, "chooseTitle" } + { ChooseTitleRole, "chooseTitle" }, + { DirectoryRole, "directory" } }; return roles; @@ -103,11 +105,6 @@ void ScorePreferencesModel::load() endResetModel(); } -QString ScorePreferencesModel::fileDirectory(const QString& filePath) const -{ - return io::dirpath(filePath.toStdString()).toQString(); -} - bool ScorePreferencesModel::isShowMIDIControls() const { return audioConfiguration()->isShowControlsInMixer(); @@ -288,7 +285,7 @@ void ScorePreferencesModel::setPath(ScorePreferencesModel::DefaultFileType fileT } m_defaultFiles[index.row()].path = path; - emit dataChanged(index, index, { PathRole }); + emit dataChanged(index, index, { PathRole, DirectoryRole }); } QModelIndex ScorePreferencesModel::fileIndex(ScorePreferencesModel::DefaultFileType fileType) @@ -302,3 +299,8 @@ QModelIndex ScorePreferencesModel::fileIndex(ScorePreferencesModel::DefaultFileT return QModelIndex(); } + +QString ScorePreferencesModel::fileDirectory(const QString& filePath) const +{ + return io::dirpath(filePath.toStdString()).toQString(); +} diff --git a/src/appshell/view/preferences/scorepreferencesmodel.h b/src/appshell/view/preferences/scorepreferencesmodel.h index 275ba31a07..44db599863 100644 --- a/src/appshell/view/preferences/scorepreferencesmodel.h +++ b/src/appshell/view/preferences/scorepreferencesmodel.h @@ -49,7 +49,6 @@ public: QHash roleNames() const override; Q_INVOKABLE void load(); - Q_INVOKABLE QString fileDirectory(const QString& filePath) const; bool isShowMIDIControls() const; @@ -64,7 +63,8 @@ private: TitleRole = Qt::UserRole + 1, PathRole, PathFilterRole, - ChooseTitleRole + ChooseTitleRole, + DirectoryRole }; enum class DefaultFileType { @@ -114,6 +114,8 @@ private: void setPath(DefaultFileType fileType, const QString& path); QModelIndex fileIndex(DefaultFileType fileType); + QString fileDirectory(const QString& filePath) const; + QList m_defaultFiles; }; } From d41218faa85bae753a6dd0c382dcb4eb13641867 Mon Sep 17 00:00:00 2001 From: Eism Date: Wed, 15 Sep 2021 21:56:58 +0200 Subject: [PATCH 08/12] Implemented accessibility for score page --- src/appshell/qml/Preferences/ScorePreferencesPage.qml | 6 ++++++ .../qml/Preferences/internal/DefaultFilesSection.qml | 9 +++++++++ .../qml/Preferences/internal/ScoreViewSection.qml | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/src/appshell/qml/Preferences/ScorePreferencesPage.qml b/src/appshell/qml/Preferences/ScorePreferencesPage.qml index fde1367ce5..394f17d707 100644 --- a/src/appshell/qml/Preferences/ScorePreferencesPage.qml +++ b/src/appshell/qml/Preferences/ScorePreferencesPage.qml @@ -48,6 +48,9 @@ PreferencesPage { DefaultFilesSection { model: scorePreferencesModel + + navigation.section: root.navigationSection + navigation.order: root.navigationOrderStart + 1 } SeparatorLine { } @@ -55,6 +58,9 @@ PreferencesPage { ScoreViewSection { isShowMIDIControls: scorePreferencesModel.isShowMIDIControls + navigation.section: root.navigationSection + navigation.order: root.navigationOrderStart + 2 + onShowMIDIControlsChangeRequested: { scorePreferencesModel.isShowMIDIControls = show } diff --git a/src/appshell/qml/Preferences/internal/DefaultFilesSection.qml b/src/appshell/qml/Preferences/internal/DefaultFilesSection.qml index 28c12354a9..5bdd13021d 100644 --- a/src/appshell/qml/Preferences/internal/DefaultFilesSection.qml +++ b/src/appshell/qml/Preferences/internal/DefaultFilesSection.qml @@ -22,6 +22,7 @@ import QtQuick 2.15 import QtQuick.Layouts 1.15 +import MuseScore.Ui 1.0 import MuseScore.UiComponents 1.0 BaseSection { @@ -29,6 +30,8 @@ BaseSection { title: qsTrc("appshell", "Default files") + navigation.direction: NavigationPanel.Both + property alias model: view.model ListView { @@ -48,6 +51,8 @@ BaseSection { spacing: 20 StyledTextLabel { + id: titleLabel + Layout.alignment: Qt.AlignLeft text: model.title + ":" @@ -63,6 +68,10 @@ BaseSection { path: model.path + navigation: root.navigation + navigationRowOrder: model.index + pathFieldTitle: titleLabel.text + onPathEdited: { model.path = newPath } diff --git a/src/appshell/qml/Preferences/internal/ScoreViewSection.qml b/src/appshell/qml/Preferences/internal/ScoreViewSection.qml index 8e229c2385..1cc84e560d 100644 --- a/src/appshell/qml/Preferences/internal/ScoreViewSection.qml +++ b/src/appshell/qml/Preferences/internal/ScoreViewSection.qml @@ -38,6 +38,10 @@ BaseSection { width: 216 text: qsTrc("appshell", "Show MIDI controls in mixer") + navigation.name: "ShowMIDIControlsBox" + navigation.panel: root.navigation + navigation.row: 0 + onClicked: { root.showMIDIControlsChangeRequested(!checked) } From 085389c8476280f6eb2f2a20b7361092d2a43604 Mon Sep 17 00:00:00 2001 From: Eism Date: Thu, 16 Sep 2021 08:30:29 +0200 Subject: [PATCH 09/12] Simplified the update page --- src/appshell/appshell.qrc | 1 + .../Preferences/AdvancedPreferencesPage.qml | 2 +- .../Preferences/AppearancePreferencesPage.qml | 2 +- .../qml/Preferences/CanvasPreferencesPage.qml | 2 +- .../Preferences/FoldersPreferencesPage.qml | 15 +++-- .../Preferences/GeneralPreferencesPage.qml | 2 +- .../qml/Preferences/IOPreferencesPage.qml | 2 +- .../qml/Preferences/ImportPreferencesPage.qml | 2 +- .../Preferences/NoteInputPreferencesPage.qml | 3 +- .../qml/Preferences/PreferencesPage.qml | 2 + .../ProgrammeStartPreferencesPage.qml | 33 +++++----- .../qml/Preferences/ScorePreferencesPage.qml | 2 +- .../qml/Preferences/UpdatePreferencesPage.qml | 35 ++++------- .../internal/AutomaticUpdateSection.qml | 62 +++++++++++++++++++ 14 files changed, 113 insertions(+), 52 deletions(-) create mode 100644 src/appshell/qml/Preferences/internal/AutomaticUpdateSection.qml diff --git a/src/appshell/appshell.qrc b/src/appshell/appshell.qrc index a40564963d..1bb4a3f408 100644 --- a/src/appshell/appshell.qrc +++ b/src/appshell/appshell.qrc @@ -92,5 +92,6 @@ qml/Preferences/internal/NoteInputPlaySection.qml qml/Preferences/internal/DefaultFilesSection.qml qml/Preferences/internal/ScoreViewSection.qml + qml/Preferences/internal/AutomaticUpdateSection.qml diff --git a/src/appshell/qml/Preferences/AdvancedPreferencesPage.qml b/src/appshell/qml/Preferences/AdvancedPreferencesPage.qml index a737980728..80eb2cd30b 100644 --- a/src/appshell/qml/Preferences/AdvancedPreferencesPage.qml +++ b/src/appshell/qml/Preferences/AdvancedPreferencesPage.qml @@ -42,7 +42,7 @@ PreferencesPage { ColumnLayout { anchors.fill: parent - spacing: 20 + spacing: root.sectionsSpacing AdvancedTopSection { id: topSection diff --git a/src/appshell/qml/Preferences/AppearancePreferencesPage.qml b/src/appshell/qml/Preferences/AppearancePreferencesPage.qml index e6e6be2811..9603df6cb4 100644 --- a/src/appshell/qml/Preferences/AppearancePreferencesPage.qml +++ b/src/appshell/qml/Preferences/AppearancePreferencesPage.qml @@ -44,7 +44,7 @@ PreferencesPage { id: content width: parent.width - spacing: 24 + spacing: root.sectionsSpacing ThemesSection { width: content.width diff --git a/src/appshell/qml/Preferences/CanvasPreferencesPage.qml b/src/appshell/qml/Preferences/CanvasPreferencesPage.qml index 29eef0005b..c3c6c463fd 100644 --- a/src/appshell/qml/Preferences/CanvasPreferencesPage.qml +++ b/src/appshell/qml/Preferences/CanvasPreferencesPage.qml @@ -41,7 +41,7 @@ PreferencesPage { Column { anchors.fill: parent - spacing: 24 + spacing: root.sectionsSpacing ZoomSection { defaultZoom: preferencesModel.defaultZoom diff --git a/src/appshell/qml/Preferences/FoldersPreferencesPage.qml b/src/appshell/qml/Preferences/FoldersPreferencesPage.qml index 5fc5da728d..3bb50f247d 100644 --- a/src/appshell/qml/Preferences/FoldersPreferencesPage.qml +++ b/src/appshell/qml/Preferences/FoldersPreferencesPage.qml @@ -40,12 +40,17 @@ PreferencesPage { foldersPreferencesModel.load() } - FoldersSection { - id: content + Column { + anchors.fill: parent + spacing: root.sectionsSpacing - model: foldersPreferencesModel + FoldersSection { + id: content - navigation.section: root.navigationSection - navigation.order: root.navigationOrderStart + 1 + model: foldersPreferencesModel + + navigation.section: root.navigationSection + navigation.order: root.navigationOrderStart + 1 + } } } diff --git a/src/appshell/qml/Preferences/GeneralPreferencesPage.qml b/src/appshell/qml/Preferences/GeneralPreferencesPage.qml index 5d58ff1224..c0885a3bad 100644 --- a/src/appshell/qml/Preferences/GeneralPreferencesPage.qml +++ b/src/appshell/qml/Preferences/GeneralPreferencesPage.qml @@ -45,7 +45,7 @@ PreferencesPage { id: content width: parent.width - spacing: 24 + spacing: root.sectionsSpacing LanguagesSection { languages: preferencesModel.languages diff --git a/src/appshell/qml/Preferences/IOPreferencesPage.qml b/src/appshell/qml/Preferences/IOPreferencesPage.qml index 10e57f54d6..c0f84551ec 100644 --- a/src/appshell/qml/Preferences/IOPreferencesPage.qml +++ b/src/appshell/qml/Preferences/IOPreferencesPage.qml @@ -43,7 +43,7 @@ PreferencesPage { id: content width: parent.width - spacing: 24 + spacing: root.sectionsSpacing readonly property int firstColumnWidth: 220 diff --git a/src/appshell/qml/Preferences/ImportPreferencesPage.qml b/src/appshell/qml/Preferences/ImportPreferencesPage.qml index 6ce98e8877..26afbf1a42 100644 --- a/src/appshell/qml/Preferences/ImportPreferencesPage.qml +++ b/src/appshell/qml/Preferences/ImportPreferencesPage.qml @@ -45,7 +45,7 @@ PreferencesPage { width: parent.width height: childrenRect.height - spacing: 24 + spacing: root.sectionsSpacing ImportStyleSection { anchors.left: parent.left diff --git a/src/appshell/qml/Preferences/NoteInputPreferencesPage.qml b/src/appshell/qml/Preferences/NoteInputPreferencesPage.qml index 2c324ce90c..3760cf5b68 100644 --- a/src/appshell/qml/Preferences/NoteInputPreferencesPage.qml +++ b/src/appshell/qml/Preferences/NoteInputPreferencesPage.qml @@ -37,8 +37,7 @@ PreferencesPage { Column { anchors.fill: parent - - spacing: 22 + spacing: root.sectionsSpacing NoteInputSection { advanceToNextNote: noteInputModel.advanceToNextNoteOnKeyRelease diff --git a/src/appshell/qml/Preferences/PreferencesPage.qml b/src/appshell/qml/Preferences/PreferencesPage.qml index 820fce12ec..abeeea92e9 100644 --- a/src/appshell/qml/Preferences/PreferencesPage.qml +++ b/src/appshell/qml/Preferences/PreferencesPage.qml @@ -39,6 +39,8 @@ Flickable { property NavigationSection navigationSection: null property int navigationOrderStart: 0 + readonly property int sectionsSpacing: 24 + signal hideRequested() function apply() { diff --git a/src/appshell/qml/Preferences/ProgrammeStartPreferencesPage.qml b/src/appshell/qml/Preferences/ProgrammeStartPreferencesPage.qml index b3ee6de580..4d10399122 100644 --- a/src/appshell/qml/Preferences/ProgrammeStartPreferencesPage.qml +++ b/src/appshell/qml/Preferences/ProgrammeStartPreferencesPage.qml @@ -34,24 +34,29 @@ PreferencesPage { id: programmeStartModel } - ProgrammeStartSection { - startupModes: programmeStartModel.startupModes - scorePathFilter: programmeStartModel.scorePathFilter() - panels: programmeStartModel.panels + Column { + anchors.fill: parent + spacing: root.sectionsSpacing - navigation.section: root.navigationSection - navigation.order: root.navigationOrderStart + 1 + ProgrammeStartSection { + startupModes: programmeStartModel.startupModes + scorePathFilter: programmeStartModel.scorePathFilter() + panels: programmeStartModel.panels - onCurrentStartupModesChanged: { - programmeStartModel.setCurrentStartupMode(index) - } + navigation.section: root.navigationSection + navigation.order: root.navigationOrderStart + 1 - onStartupScorePathChanged: { - programmeStartModel.setStartupScorePath(path) - } + onCurrentStartupModesChanged: { + programmeStartModel.setCurrentStartupMode(index) + } - onPanelsVisibleChanged: { - programmeStartModel.setPanelVisible(panelIndex, visible) + onStartupScorePathChanged: { + programmeStartModel.setStartupScorePath(path) + } + + onPanelsVisibleChanged: { + programmeStartModel.setPanelVisible(panelIndex, visible) + } } } } diff --git a/src/appshell/qml/Preferences/ScorePreferencesPage.qml b/src/appshell/qml/Preferences/ScorePreferencesPage.qml index 394f17d707..b84386131c 100644 --- a/src/appshell/qml/Preferences/ScorePreferencesPage.qml +++ b/src/appshell/qml/Preferences/ScorePreferencesPage.qml @@ -44,7 +44,7 @@ PreferencesPage { id: content width: parent.width - spacing: 24 + spacing: root.sectionsSpacing DefaultFilesSection { model: scorePreferencesModel diff --git a/src/appshell/qml/Preferences/UpdatePreferencesPage.qml b/src/appshell/qml/Preferences/UpdatePreferencesPage.qml index dd7d23d17a..17ca0681f2 100644 --- a/src/appshell/qml/Preferences/UpdatePreferencesPage.qml +++ b/src/appshell/qml/Preferences/UpdatePreferencesPage.qml @@ -25,6 +25,8 @@ import MuseScore.Ui 1.0 import MuseScore.UiComponents 1.0 import MuseScore.Preferences 1.0 +import "internal" + PreferencesPage { id: root @@ -34,34 +36,19 @@ PreferencesPage { Column { anchors.fill: parent + spacing: root.sectionsSpacing - spacing: 18 + AutomaticUpdateSection { + isAppUpdatable: updateModel.isAppUpdatable() + needCheckForNewAppVersion: updateModel.needCheckForNewAppVersion + needCheckForNewExtensionsVersion: updateModel.needCheckForNewExtensionsVersion - StyledTextLabel { - text: qsTrc("appshell", "Automatic update check") - font: ui.theme.bodyBoldFont - } - - CheckBox { - text: qsTrc("appshell", "Check for new version of MuseScore") - - visible: updateModel.isAppUpdatable() - checked: updateModel.needCheckForNewAppVersion - - onClicked: { - updateModel.needCheckForNewAppVersion = !checked + onNeedCheckForNewAppVersionChangeRequested: { + updateModel.needCheckForNewAppVersion = check } - } - CheckBox { - width: 200 - - text: qsTrc("appshell", "Check for new version of MuseScore extensions") - - checked: updateModel.needCheckForNewExtensionsVersion - - onClicked: { - updateModel.needCheckForNewExtensionsVersion = !checked + onNeedCheckForNewExtensionsVersionChangeRequested: { + updateModel.needCheckForNewExtensionsVersion = check } } } diff --git a/src/appshell/qml/Preferences/internal/AutomaticUpdateSection.qml b/src/appshell/qml/Preferences/internal/AutomaticUpdateSection.qml new file mode 100644 index 0000000000..5bf621798f --- /dev/null +++ b/src/appshell/qml/Preferences/internal/AutomaticUpdateSection.qml @@ -0,0 +1,62 @@ +/* + * 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 . + */ +import QtQuick 2.15 + +import MuseScore.Ui 1.0 +import MuseScore.UiComponents 1.0 + +BaseSection { + id: root + + title: qsTrc("appshell", "Automatic update check") + + property bool isAppUpdatable: true + property alias needCheckForNewAppVersion: needCheckBox.checked + property alias needCheckForNewExtensionsVersion: needCheckForNewExtensionsVersionBox.checked + + signal needCheckForNewAppVersionChangeRequested(bool check) + signal needCheckForNewExtensionsVersionChangeRequested(bool check) + + CheckBox { + id: needCheckBox + + text: qsTrc("appshell", "Check for new version of MuseScore") + + visible: root.isAppUpdatable + + onClicked: { + root.needCheckForNewAppVersionChangeRequested(!checked) + } + } + + CheckBox { + id: needCheckForNewExtensionsVersionBox + + width: 200 + + text: qsTrc("appshell", "Check for new version of MuseScore extensions") + + onClicked: { + root.needCheckForNewExtensionsVersionChangeRequested(!checked) + } + } +} From 5d9670fc058f7a9a5c846bf9886dadd1997cfe94 Mon Sep 17 00:00:00 2001 From: Eism Date: Thu, 16 Sep 2021 08:32:53 +0200 Subject: [PATCH 10/12] Implemented accessibility for update page --- src/appshell/qml/Preferences/UpdatePreferencesPage.qml | 3 +++ .../qml/Preferences/internal/AutomaticUpdateSection.qml | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/appshell/qml/Preferences/UpdatePreferencesPage.qml b/src/appshell/qml/Preferences/UpdatePreferencesPage.qml index 17ca0681f2..709a10b415 100644 --- a/src/appshell/qml/Preferences/UpdatePreferencesPage.qml +++ b/src/appshell/qml/Preferences/UpdatePreferencesPage.qml @@ -43,6 +43,9 @@ PreferencesPage { needCheckForNewAppVersion: updateModel.needCheckForNewAppVersion needCheckForNewExtensionsVersion: updateModel.needCheckForNewExtensionsVersion + navigation.section: root.navigationSection + navigation.order: root.navigationOrderStart + 1 + onNeedCheckForNewAppVersionChangeRequested: { updateModel.needCheckForNewAppVersion = check } diff --git a/src/appshell/qml/Preferences/internal/AutomaticUpdateSection.qml b/src/appshell/qml/Preferences/internal/AutomaticUpdateSection.qml index 5bf621798f..a69dbc8240 100644 --- a/src/appshell/qml/Preferences/internal/AutomaticUpdateSection.qml +++ b/src/appshell/qml/Preferences/internal/AutomaticUpdateSection.qml @@ -43,6 +43,10 @@ BaseSection { visible: root.isAppUpdatable + navigation.name: "NeedCheckBox" + navigation.panel: root.navigation + navigation.row: 0 + onClicked: { root.needCheckForNewAppVersionChangeRequested(!checked) } @@ -55,6 +59,10 @@ BaseSection { text: qsTrc("appshell", "Check for new version of MuseScore extensions") + navigation.name: "NeedCheckExtensionsBox" + navigation.panel: root.navigation + navigation.row: 1 + onClicked: { root.needCheckForNewExtensionsVersionChangeRequested(!checked) } From 78a05735820c8e05c631b9770253ce43f9842284 Mon Sep 17 00:00:00 2001 From: Eism Date: Thu, 16 Sep 2021 09:14:33 +0200 Subject: [PATCH 11/12] Simplified the import page --- .../qml/Preferences/ImportPreferencesPage.qml | 48 ++++++--- .../Preferences/internal/CharsetsSection.qml | 57 +++++------ .../internal/ImportStyleSection.qml | 99 +++++++++---------- .../qml/Preferences/internal/MidiSection.qml | 22 ++--- .../Preferences/internal/MusicXmlSection.qml | 65 ++++++------ 5 files changed, 154 insertions(+), 137 deletions(-) diff --git a/src/appshell/qml/Preferences/ImportPreferencesPage.qml b/src/appshell/qml/Preferences/ImportPreferencesPage.qml index 26afbf1a42..56678e9635 100644 --- a/src/appshell/qml/Preferences/ImportPreferencesPage.qml +++ b/src/appshell/qml/Preferences/ImportPreferencesPage.qml @@ -48,37 +48,61 @@ PreferencesPage { spacing: root.sectionsSpacing ImportStyleSection { - anchors.left: parent.left - anchors.right: parent.right + styleFileImportPath: importPreferencesModel.styleFileImportPath + fileChooseTitle: importPreferencesModel.styleChooseTitle() + filePathFilter: importPreferencesModel.stylePathFilter() + fileDirectory: importPreferencesModel.fileDirectory(styleFileImportPath) - preferencesModel: importPreferencesModel + onStyleFileImportPathChangeRequested: { + importPreferencesModel.styleFileImportPath = path + } } SeparatorLine { } CharsetsSection { - anchors.left: parent.left - anchors.right: parent.right + charsets: importPreferencesModel.charsets() + currentGuitarProCharset: importPreferencesModel.currentGuitarProCharset + currentOvertuneCharset: importPreferencesModel.currentOvertuneCharset - preferencesModel: importPreferencesModel + onGuitarProCharsetChangeRequested: { + importPreferencesModel.currentGuitarProCharset = charset + } + + onOvertuneCharsetChangeRequested: { + importPreferencesModel.currentOvertuneCharset = charset + } } SeparatorLine { } MusicXmlSection { - anchors.left: parent.left - anchors.right: parent.right + importLayout: importPreferencesModel.importLayout + importBreaks: importPreferencesModel.importBreaks + needUseDefaultFont: importPreferencesModel.needUseDefaultFont - preferencesModel: importPreferencesModel + onImportLayoutChangeRequested: { + importPreferencesModel.importLayout = importLayout + } + + onImportBreaksChangeRequested: { + importPreferencesModel.importBreaks = importBreaks + } + + onUseDefaultFontChangeRequested: { + importPreferencesModel.needUseDefaultFont = use + } } SeparatorLine { } MidiSection { - anchors.left: parent.left - anchors.right: parent.right + shortestNotes: importPreferencesModel.shortestNotes() + currentShortestNote: importPreferencesModel.currentShortestNote - preferencesModel: importPreferencesModel + onCurrentShortestNoteChangeRequested: { + importPreferencesModel.currentShortestNote = note + } } } } diff --git a/src/appshell/qml/Preferences/internal/CharsetsSection.qml b/src/appshell/qml/Preferences/internal/CharsetsSection.qml index 8575fca561..9634c187ae 100644 --- a/src/appshell/qml/Preferences/internal/CharsetsSection.qml +++ b/src/appshell/qml/Preferences/internal/CharsetsSection.qml @@ -22,43 +22,40 @@ import QtQuick 2.15 import MuseScore.UiComponents 1.0 -import MuseScore.Preferences 1.0 -Column { - spacing: 18 +BaseSection { + id: root - property var preferencesModel: null + title: qsTrc("appshell", "Character set used when importing binary files") - StyledTextLabel { - text: qsTrc("appshell", "Character set used when importing binary files") - font: ui.theme.bodyBoldFont + property var charsets: null + property string currentGuitarProCharset: "" + property string currentOvertuneCharset: "" + + signal guitarProCharsetChangeRequested(string charset) + signal overtuneCharsetChangeRequested(string charset) + + ComboBoxWithTitle { + title: qsTrc("appshell", "Guitar Pro import character set:") + titleWidth: 220 + + currentIndex: control.indexOfValue(root.currentGuitarProCharset) + model: root.charsets + + onValueEdited: { + root.guitarProCharsetChangeRequested(newValue) + } } - Column { - spacing: 12 + ComboBoxWithTitle { + title: qsTrc("appshell", "Overture import character set:") + titleWidth: 220 - ComboBoxWithTitle { - title: qsTrc("appshell", "Guitar Pro import character set:") - titleWidth: 220 + currentIndex: control.indexOfValue(root.currentOvertuneCharset) + model: root.charsets - currentIndex: control.indexOfValue(preferencesModel.currentGuitarProCharset) - model: preferencesModel.charsets() - - onValueEdited: { - preferencesModel.currentGuitarProCharset = newValue - } - } - - ComboBoxWithTitle { - title: qsTrc("appshell", "Overture import character set:") - titleWidth: 220 - - currentIndex: control.indexOfValue(preferencesModel.currentOvertuneCharset) - model: preferencesModel.charsets() - - onValueEdited: { - preferencesModel.currentOvertuneCharset = newValue - } + onValueEdited: { + root.overtuneCharsetChangeRequested(newValue) } } } diff --git a/src/appshell/qml/Preferences/internal/ImportStyleSection.qml b/src/appshell/qml/Preferences/internal/ImportStyleSection.qml index a94f7c5bf0..47178b87fa 100644 --- a/src/appshell/qml/Preferences/internal/ImportStyleSection.qml +++ b/src/appshell/qml/Preferences/internal/ImportStyleSection.qml @@ -22,74 +22,69 @@ import QtQuick 2.15 import MuseScore.UiComponents 1.0 -import MuseScore.Preferences 1.0 -Column { - spacing: 18 +BaseSection { + id: root - property var preferencesModel: null + title: qsTrc("appshell", "Style used for import") - StyledTextLabel { - text: qsTrc("appshell", "Style used for import") - font: ui.theme.bodyBoldFont - } + property string styleFileImportPath: "" + property string fileChooseTitle: "" + property string filePathFilter: "" + property string fileDirectory: "" - Column { + signal styleFileImportPathChangeRequested(string path) + + RoundedRadioButton { anchors.left: parent.left anchors.right: parent.right - spacing: 12 - RoundedRadioButton { - anchors.left: parent.left - anchors.right: parent.right + checked: root.styleFileImportPath === "" - checked: preferencesModel.styleFileImportPath === "" + StyledTextLabel { + text: qsTrc("appshell", "Built-in style") + horizontalAlignment: Text.AlignLeft + } + onToggled: { + root.styleFileImportPathChangeRequested("") + } + } + + RoundedRadioButton { + anchors.left: parent.left + anchors.right: parent.right + + checked: root.styleFileImportPath !== "" + + onToggled: { + root.styleFileImportPathChangeRequested("") + } + + Item { StyledTextLabel { - text: qsTrc("appshell", "Built-in style") + id: title + + width: 193 + anchors.verticalCenter: parent.verticalCenter + + text: qsTrc("appshell", "Use style file:") horizontalAlignment: Text.AlignLeft } - onToggled: { - preferencesModel.styleFileImportPath = "" - } - } + FilePicker { + anchors.left: title.right + width: 246 + anchors.verticalCenter: parent.verticalCenter - RoundedRadioButton { - anchors.left: parent.left - anchors.right: parent.right + dialogTitle: root.fileChooseTitle + filter: root.filePathFilter + dir: root.fileDirectory - checked: preferencesModel.styleFileImportPath !== "" + path: root.styleFileImportPath - onToggled: { - preferencesModel.styleFileImportPath = "" - } - - Item { - StyledTextLabel { - id: title - - width: 193 - anchors.verticalCenter: parent.verticalCenter - - text: qsTrc("appshell", "Use style file:") - horizontalAlignment: Text.AlignLeft - } - - FilePicker { - anchors.left: title.right - width: 246 - anchors.verticalCenter: parent.verticalCenter - - dialogTitle: preferencesModel.styleChooseTitle() - filter: preferencesModel.stylePathFilter() - dir: preferencesModel.fileDirectory(preferencesModel.styleFileImportPath) - - path: preferencesModel.styleFileImportPath - - onPathEdited: { - preferencesModel.styleFileImportPath = newPath - } + onPathEdited: { + root.styleFileImportPathChangeRequested(newPath) } } } diff --git a/src/appshell/qml/Preferences/internal/MidiSection.qml b/src/appshell/qml/Preferences/internal/MidiSection.qml index 57dd6404e4..b8cb66135d 100644 --- a/src/appshell/qml/Preferences/internal/MidiSection.qml +++ b/src/appshell/qml/Preferences/internal/MidiSection.qml @@ -22,30 +22,30 @@ import QtQuick 2.15 import MuseScore.UiComponents 1.0 -import MuseScore.Preferences 1.0 -Column { - spacing: 18 +BaseSection { + id: root - property var preferencesModel: null + title: qsTrc("appshell", "MIDI") - StyledTextLabel { - text: qsTrc("appshell", "MIDI") - font: ui.theme.bodyBoldFont - } + property alias shortestNotes: shortestNotesBox.model + property int currentShortestNote: 0 + + signal currentShortestNoteChangeRequested(int note) ComboBoxWithTitle { + id: shortestNotesBox + title: qsTrc("appshell", "Shortest note:") titleWidth: 220 - currentIndex: control.indexOfValue(preferencesModel.currentShortestNote) - model: preferencesModel.shortestNotes() + currentIndex: control.indexOfValue(root.currentShortestNote) control.textRole: "title" control.valueRole: "value" onValueEdited: { - preferencesModel.currentShortestNote = newValue + root.currentShortestNoteChangeRequested(newValue) } } } diff --git a/src/appshell/qml/Preferences/internal/MusicXmlSection.qml b/src/appshell/qml/Preferences/internal/MusicXmlSection.qml index 89a9df4c5e..d06b5e588e 100644 --- a/src/appshell/qml/Preferences/internal/MusicXmlSection.qml +++ b/src/appshell/qml/Preferences/internal/MusicXmlSection.qml @@ -22,49 +22,50 @@ import QtQuick 2.15 import MuseScore.UiComponents 1.0 -import MuseScore.Preferences 1.0 -Column { - spacing: 18 +BaseSection { + id: root - property var preferencesModel: null + title: qsTrc("appshell", "MusicXML") - StyledTextLabel { - text: qsTrc("appshell", "MusicXML") - font: ui.theme.bodyBoldFont + property alias importLayout: importLayoutBox.checked + property alias importBreaks: importBreaksBox.checked + property alias needUseDefaultFont: needUseDefaultFontBox.checked + + signal importLayoutChangeRequested(bool importLayout) + signal importBreaksChangeRequested(bool importBreaks) + signal useDefaultFontChangeRequested(bool use) + + CheckBox { + id: importLayoutBox + + width: 208 + text: qsTrc("appshell", "Import layout") + + onClicked: { + root.importLayoutChangeRequested(!checked) + } } - Column { - spacing: 12 + CheckBox { + id: importBreaksBox - CheckBox { - width: 208 - text: qsTrc("appshell", "Import layout") - checked: preferencesModel.importLayout + width: 208 + text: qsTrc("appshell", "Import system and page breaks") - onClicked: { - preferencesModel.importLayout = !preferencesModel.importLayout - } + onClicked: { + root.importBreaksChangeRequested(!checked) } + } - CheckBox { - width: 208 - text: qsTrc("appshell", "Import system and page breaks") - checked: preferencesModel.importBreaks + CheckBox { + id: needUseDefaultFontBox - onClicked: { - preferencesModel.importBreaks = !preferencesModel.importBreaks - } - } + width: 208 + text: qsTrc("appshell", "Apply default typeface (Edwin) to imported scores") - CheckBox { - width: 208 - text: qsTrc("appshell", "Apply default typeface (Edwin) to imported scores") - checked: preferencesModel.needUseDefaultFont - - onClicked: { - preferencesModel.needUseDefaultFont = !preferencesModel.needUseDefaultFont - } + onClicked: { + root.useDefaultFontChangeRequested(!checked) } } } From ac4522a9eff3419621c3aae6917ec593d7efc0b5 Mon Sep 17 00:00:00 2001 From: Eism Date: Thu, 16 Sep 2021 09:47:09 +0200 Subject: [PATCH 12/12] Implemented accessibility for import page --- .../qml/Preferences/ImportPreferencesPage.qml | 36 ++++++++ .../Preferences/internal/CharsetsSection.qml | 8 ++ .../internal/ColorAndWallpaperSection.qml | 2 +- .../internal/DefaultFilesSection.qml | 2 +- .../Preferences/internal/FoldersSection.qml | 2 +- .../internal/ImportStyleSection.qml | 82 +++++++++++-------- .../qml/Preferences/internal/MidiSection.qml | 4 + .../Preferences/internal/MusicXmlSection.qml | 12 +++ .../internal/ProgrammeStartSection.qml | 2 +- .../qml/MuseScore/UiComponents/FilePicker.qml | 6 +- 10 files changed, 117 insertions(+), 39 deletions(-) diff --git a/src/appshell/qml/Preferences/ImportPreferencesPage.qml b/src/appshell/qml/Preferences/ImportPreferencesPage.qml index 56678e9635..c8bffd33bb 100644 --- a/src/appshell/qml/Preferences/ImportPreferencesPage.qml +++ b/src/appshell/qml/Preferences/ImportPreferencesPage.qml @@ -53,9 +53,18 @@ PreferencesPage { filePathFilter: importPreferencesModel.stylePathFilter() fileDirectory: importPreferencesModel.fileDirectory(styleFileImportPath) + navigation.section: root.navigationSection + navigation.order: root.navigationOrderStart + 1 + onStyleFileImportPathChangeRequested: { importPreferencesModel.styleFileImportPath = path } + + onFocusChanged: { + if (activeFocus) { + root.ensureContentVisibleRequested(Qt.rect(x, y, width, height)) + } + } } SeparatorLine { } @@ -65,6 +74,9 @@ PreferencesPage { currentGuitarProCharset: importPreferencesModel.currentGuitarProCharset currentOvertuneCharset: importPreferencesModel.currentOvertuneCharset + navigation.section: root.navigationSection + navigation.order: root.navigationOrderStart + 2 + onGuitarProCharsetChangeRequested: { importPreferencesModel.currentGuitarProCharset = charset } @@ -72,6 +84,12 @@ PreferencesPage { onOvertuneCharsetChangeRequested: { importPreferencesModel.currentOvertuneCharset = charset } + + onFocusChanged: { + if (activeFocus) { + root.ensureContentVisibleRequested(Qt.rect(x, y, width, height)) + } + } } SeparatorLine { } @@ -81,6 +99,9 @@ PreferencesPage { importBreaks: importPreferencesModel.importBreaks needUseDefaultFont: importPreferencesModel.needUseDefaultFont + navigation.section: root.navigationSection + navigation.order: root.navigationOrderStart + 3 + onImportLayoutChangeRequested: { importPreferencesModel.importLayout = importLayout } @@ -92,6 +113,12 @@ PreferencesPage { onUseDefaultFontChangeRequested: { importPreferencesModel.needUseDefaultFont = use } + + onFocusChanged: { + if (activeFocus) { + root.ensureContentVisibleRequested(Qt.rect(x, y, width, height)) + } + } } SeparatorLine { } @@ -100,9 +127,18 @@ PreferencesPage { shortestNotes: importPreferencesModel.shortestNotes() currentShortestNote: importPreferencesModel.currentShortestNote + navigation.section: root.navigationSection + navigation.order: root.navigationOrderStart + 4 + onCurrentShortestNoteChangeRequested: { importPreferencesModel.currentShortestNote = note } + + onFocusChanged: { + if (activeFocus) { + root.ensureContentVisibleRequested(Qt.rect(x, y, width, height)) + } + } } } } diff --git a/src/appshell/qml/Preferences/internal/CharsetsSection.qml b/src/appshell/qml/Preferences/internal/CharsetsSection.qml index 9634c187ae..f27da5a2fe 100644 --- a/src/appshell/qml/Preferences/internal/CharsetsSection.qml +++ b/src/appshell/qml/Preferences/internal/CharsetsSection.qml @@ -42,6 +42,10 @@ BaseSection { currentIndex: control.indexOfValue(root.currentGuitarProCharset) model: root.charsets + navigation.name: "GuitarProBox" + navigation.panel: root.navigation + navigation.row: 0 + onValueEdited: { root.guitarProCharsetChangeRequested(newValue) } @@ -54,6 +58,10 @@ BaseSection { currentIndex: control.indexOfValue(root.currentOvertuneCharset) model: root.charsets + navigation.name: "OvertureBox" + navigation.panel: root.navigation + navigation.row: 1 + onValueEdited: { root.overtuneCharsetChangeRequested(newValue) } diff --git a/src/appshell/qml/Preferences/internal/ColorAndWallpaperSection.qml b/src/appshell/qml/Preferences/internal/ColorAndWallpaperSection.qml index ad45d41a44..a06a6a0049 100644 --- a/src/appshell/qml/Preferences/internal/ColorAndWallpaperSection.qml +++ b/src/appshell/qml/Preferences/internal/ColorAndWallpaperSection.qml @@ -114,7 +114,7 @@ BaseSection { enabled: !root.useColor navigation: root.navigation - navigationRowOrder: 1 + navigationRowOrderStart: 1 navigationColumnOrderStart: 1 onPathEdited: { diff --git a/src/appshell/qml/Preferences/internal/DefaultFilesSection.qml b/src/appshell/qml/Preferences/internal/DefaultFilesSection.qml index 5bdd13021d..818612e4c0 100644 --- a/src/appshell/qml/Preferences/internal/DefaultFilesSection.qml +++ b/src/appshell/qml/Preferences/internal/DefaultFilesSection.qml @@ -69,7 +69,7 @@ BaseSection { path: model.path navigation: root.navigation - navigationRowOrder: model.index + navigationRowOrderStart: model.index pathFieldTitle: titleLabel.text onPathEdited: { diff --git a/src/appshell/qml/Preferences/internal/FoldersSection.qml b/src/appshell/qml/Preferences/internal/FoldersSection.qml index 05cb79f144..32a300ed6f 100644 --- a/src/appshell/qml/Preferences/internal/FoldersSection.qml +++ b/src/appshell/qml/Preferences/internal/FoldersSection.qml @@ -69,7 +69,7 @@ BaseSection { path: model.path navigation: root.navigation - navigationRowOrder: model.index + navigationRowOrderStart: model.index pathFieldTitle: titleLabel.text onPathEdited: { diff --git a/src/appshell/qml/Preferences/internal/ImportStyleSection.qml b/src/appshell/qml/Preferences/internal/ImportStyleSection.qml index 47178b87fa..0c42004366 100644 --- a/src/appshell/qml/Preferences/internal/ImportStyleSection.qml +++ b/src/appshell/qml/Preferences/internal/ImportStyleSection.qml @@ -21,6 +21,7 @@ */ import QtQuick 2.15 +import MuseScore.Ui 1.0 import MuseScore.UiComponents 1.0 BaseSection { @@ -28,6 +29,8 @@ BaseSection { title: qsTrc("appshell", "Style used for import") + navigation.direction: NavigationPanel.Both + property string styleFileImportPath: "" property string fileChooseTitle: "" property string filePathFilter: "" @@ -35,57 +38,72 @@ BaseSection { signal styleFileImportPathChangeRequested(string path) + QtObject { + id: prv + + property bool useStyleFile: root.styleFileImportPath !== "" + } + RoundedRadioButton { - anchors.left: parent.left - anchors.right: parent.right + id: builtInStyleButton + width: 193 - checked: root.styleFileImportPath === "" + text: qsTrc("appshell", "Built-in style") + checked: !prv.useStyleFile - StyledTextLabel { - text: qsTrc("appshell", "Built-in style") - horizontalAlignment: Text.AlignLeft - } + navigation.name: "BuiltInStyleButton" + navigation.panel: root.navigation + navigation.row: 0 + navigation.column: 0 onToggled: { + prv.useStyleFile = false root.styleFileImportPathChangeRequested("") } } - RoundedRadioButton { - anchors.left: parent.left - anchors.right: parent.right + Row { + width: parent.width - checked: root.styleFileImportPath !== "" + RoundedRadioButton { + id: useStyleFileButton - onToggled: { - root.styleFileImportPathChangeRequested("") + width: 193 + anchors.verticalCenter: parent.verticalCenter + + text: qsTrc("appshell", "Use style file:") + checked: prv.useStyleFile + + navigation.name: "UseStyleButton" + navigation.panel: root.navigation + navigation.row: 1 + navigation.column: 0 + + onToggled: { + prv.useStyleFile = true + } } - Item { - StyledTextLabel { - id: title + FilePicker { + id: styleFilePicker - width: 193 - anchors.verticalCenter: parent.verticalCenter + width: 246 + anchors.verticalCenter: parent.verticalCenter - text: qsTrc("appshell", "Use style file:") - horizontalAlignment: Text.AlignLeft - } + dialogTitle: root.fileChooseTitle + filter: root.filePathFilter + dir: root.fileDirectory - FilePicker { - anchors.left: title.right - width: 246 - anchors.verticalCenter: parent.verticalCenter + path: root.styleFileImportPath - dialogTitle: root.fileChooseTitle - filter: root.filePathFilter - dir: root.fileDirectory + enabled: prv.useStyleFile - path: root.styleFileImportPath + navigation: root.navigation + navigationRowOrderStart: 1 + navigationColumnOrderStart: 1 - onPathEdited: { - root.styleFileImportPathChangeRequested(newPath) - } + onPathEdited: { + root.styleFileImportPathChangeRequested(newPath) } } } diff --git a/src/appshell/qml/Preferences/internal/MidiSection.qml b/src/appshell/qml/Preferences/internal/MidiSection.qml index b8cb66135d..abc5e2bc2c 100644 --- a/src/appshell/qml/Preferences/internal/MidiSection.qml +++ b/src/appshell/qml/Preferences/internal/MidiSection.qml @@ -44,6 +44,10 @@ BaseSection { control.textRole: "title" control.valueRole: "value" + navigation.name: "ShortestNoteBox" + navigation.panel: root.navigation + navigation.row: 0 + onValueEdited: { root.currentShortestNoteChangeRequested(newValue) } diff --git a/src/appshell/qml/Preferences/internal/MusicXmlSection.qml b/src/appshell/qml/Preferences/internal/MusicXmlSection.qml index d06b5e588e..1753ffae9a 100644 --- a/src/appshell/qml/Preferences/internal/MusicXmlSection.qml +++ b/src/appshell/qml/Preferences/internal/MusicXmlSection.qml @@ -42,6 +42,10 @@ BaseSection { width: 208 text: qsTrc("appshell", "Import layout") + navigation.name: "ImportLayoutBox" + navigation.panel: root.navigation + navigation.row: 0 + onClicked: { root.importLayoutChangeRequested(!checked) } @@ -53,6 +57,10 @@ BaseSection { width: 208 text: qsTrc("appshell", "Import system and page breaks") + navigation.name: "ImportBreaksBox" + navigation.panel: root.navigation + navigation.row: 1 + onClicked: { root.importBreaksChangeRequested(!checked) } @@ -64,6 +72,10 @@ BaseSection { width: 208 text: qsTrc("appshell", "Apply default typeface (Edwin) to imported scores") + navigation.name: "UseDefaultFontBox" + navigation.panel: root.navigation + navigation.row: 2 + onClicked: { root.useDefaultFontChangeRequested(!checked) } diff --git a/src/appshell/qml/Preferences/internal/ProgrammeStartSection.qml b/src/appshell/qml/Preferences/internal/ProgrammeStartSection.qml index d3cb645d9f..8e25f8fa56 100644 --- a/src/appshell/qml/Preferences/internal/ProgrammeStartSection.qml +++ b/src/appshell/qml/Preferences/internal/ProgrammeStartSection.qml @@ -79,7 +79,7 @@ BaseSection { path: modelData.scorePath navigation: root.navigation - navigationRowOrder: model.index + navigationRowOrderStart: model.index navigationColumnOrderStart: 1 onPathEdited: { diff --git a/src/framework/uicomponents/qml/MuseScore/UiComponents/FilePicker.qml b/src/framework/uicomponents/qml/MuseScore/UiComponents/FilePicker.qml index 7998301b6a..0a9d523207 100644 --- a/src/framework/uicomponents/qml/MuseScore/UiComponents/FilePicker.qml +++ b/src/framework/uicomponents/qml/MuseScore/UiComponents/FilePicker.qml @@ -41,7 +41,7 @@ Item { property alias dir: filePickerModel.dir property NavigationPanel navigation: null - property int navigationRowOrder: 0 + property int navigationRowOrderStart: 0 property int navigationColumnOrderStart: 0 property string pathFieldTitle: qsTrc("uicomponents", "Current path:") @@ -65,7 +65,7 @@ Item { navigation.name: "PathFieldBox" navigation.panel: root.navigation - navigation.row: root.navigationRowOrder + navigation.row: root.navigationRowOrderStart navigation.enabled: root.visible && root.enabled navigation.column: root.navigationColumnOrderStart navigation.accessible.name: root.pathFieldTitle + " " + pathField.currentText @@ -81,7 +81,7 @@ Item { navigation.name: "FilePickerButton" navigation.panel: root.navigation - navigation.row: root.navigationRowOrder + navigation.row: root.navigationRowOrderStart navigation.enabled: root.visible && root.enabled navigation.column: root.navigationColumnOrderStart + 1 accessible.name: root.pickerType === FilePicker.PickerType.File ? qsTrc("uicomponents", "File choose")