Skip to content

Commit

Permalink
Merge pull request #13416 from Eism/accessibility_migration_dialog
Browse files Browse the repository at this point in the history
fixed #13358: Added navigation and accessibility for migration dialog
  • Loading branch information
RomanPudashkin authored Sep 22, 2022
2 parents 2f8b8b4 + c5ebdbd commit 3920500
Show file tree
Hide file tree
Showing 5 changed files with 463 additions and 197 deletions.
4 changes: 3 additions & 1 deletion src/project/project.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<file>qml/MuseScore/Project/internal/NewScore/TimeSignatureView.qml</file>
<file>qml/MuseScore/Project/internal/NewScore/TitleListView.qml</file>
<file>qml/MuseScore/Project/MigrationDialog.qml</file>
<file>qml/MuseScore/Project/migration.png</file>
<file>qml/MuseScore/Project/internal/SaveToCloud/SaveLocationOption.qml</file>
<file>qml/MuseScore/Project/internal/SaveToCloud/images/Cloud.png</file>
<file>qml/MuseScore/Project/internal/SaveToCloud/images/Laptop.png</file>
Expand All @@ -55,5 +54,8 @@
<file>resources/Placeholder_Other.png</file>
<file>resources/CloudProject.svg</file>
<file>resources/PublishScores.png</file>
<file>qml/MuseScore/Project/internal/Migration/MigrationContentFor362.qml</file>
<file>qml/MuseScore/Project/internal/Migration/MigrationContentForPre362.qml</file>
<file>qml/MuseScore/Project/internal/Migration/migration.png</file>
</qresource>
</RCC>
236 changes: 40 additions & 196 deletions src/project/qml/MuseScore/Project/MigrationDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ import MuseScore.Ui 1.0
import MuseScore.UiComponents 1.0
import MuseScore.Project 1.0

import "internal/Migration"

StyledDialogView {
id: dialog

title: qsTrc("project/migration", "Style improvements")
//! TODO: After setting title the accessibility for this dialog on VoiceOver stops working
//title: qsTrc("project/migration", "Style improvements")

property string appVersion: ""
property int migrationType: MigrationType.Unknown
Expand Down Expand Up @@ -105,75 +108,36 @@ StyledDialogView {
Loader {
id: loader
anchors.fill: parent

onLoaded: {
item.activateNavigation()
}
}

//! NOTE for 3.6.2
Component {
id: noteComp

ColumnLayout {
id: content

MigrationContentFor362 {
anchors.fill: parent
anchors.margins: 16
spacing: 16

StyledTextLabel {
id: headerTitle

Layout.fillWidth: true

font: ui.theme.tabBoldFont
appVersion: dialog.appVersion
isAskAgain: dialog.isAskAgain

horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignTop
navigationPanel.section: dialog.navigationSection

text: qsTrc("project/migration", "This file was last saved in MuseScore %1").arg(dialog.appVersion)
onIsAskAgainChangeRequested: {
dialog.isAskAgain = !dialog.isAskAgain
}

StyledTextLabel {
id: headerSubtitle

Layout.fillWidth: true
Layout.fillHeight: true

horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
elide: Text.ElideNone

text: qsTrc("project/migration", "Please note that the appearance of your score will change due to improvements we have made to default settings for beaming, ties, slurs, system objects and horizontal spacing.")
}

CheckBox {
id: askAgain

Layout.fillWidth: true

text: qsTrc("global", "Don't show this message again")
checked: !dialog.isAskAgain
onClicked: { dialog.isAskAgain = !dialog.isAskAgain }
onWatchVideoRequested: {
dialog.watchVideo()
}

RowLayout {
FlatButton {
id: watchVideo

text: qsTrc("project/migration", "Watch video about changes")
onClicked: { dialog.watchVideo() }
}

Item { Layout.fillWidth: true } // spacer

FlatButton {
id: applyBtn

text: qsTrc("global", "OK")
onClicked: {
dialog.ret = dialog.makeRet(true)
dialog.hide()
}
}
onAccess: {
dialog.ret = dialog.makeRet(true)
dialog.hide()
}
}
}
Expand All @@ -182,151 +146,31 @@ StyledDialogView {
Component {
id: migrComp

Item {
id: content

MigrationContentForPre362 {
anchors.fill: parent

Column {
id: mainContent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: 16
height: childrenRect.height

StyledTextLabel {
id: headerTitle
anchors.left: parent.left
anchors.right: parent.right
height: 32

font: ui.theme.tabBoldFont

horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter

text: qsTrc("project/migration", "This file was last saved in MuseScore %1").arg(dialog.appVersion)
}

StyledTextLabel {
id: headerSubtitle
anchors.left: parent.left
anchors.right: parent.right
height: 24

horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter

text: qsTrc("project/migration", "Select the engraving improvements you would like to apply to your score")
}

Item {
id: imageItem
anchors.left: parent.left
anchors.right: parent.right
height: 264

Image {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
height: 200
fillMode: Image.PreserveAspectFit
source: "migration.png"
}
}

CheckBox {
id: lelandOption
anchors.left: parent.left
height: 32
text: qsTrc("project/migration", "Our new notation font, Leland")
checked: dialog.isApplyLeland
onClicked: dialog.isApplyLeland = !dialog.isApplyLeland
}

CheckBox {
id: edwinOption
anchors.left: parent.left
height: 32
text: qsTrc("project/migration", "Our new text font, Edwin")
checked: dialog.isApplyEdwin
onClicked: dialog.isApplyEdwin = !dialog.isApplyEdwin
}

CheckBox {
id: spacingOption
anchors.left: parent.left
height: 32
text: qsTrc("project/migration", "Automatic spacing (introduced in MuseScore 3.0)")
visible: dialog.migrationType === MigrationType.Pre300
checked: dialog.isApplyAutoSpacing
onClicked: dialog.isApplyAutoSpacing = !dialog.isApplyAutoSpacing
}

Item {
width: 1
height: 16
}

StyledTextLabel {
id: noteLabel
anchors.left: parent.left
anchors.right: parent.right
height: 32

horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter

text: qsTrc("project/migration", "Please note: score layouts will be affected by improvements to MuseScore 4")
}

FlatButton {
id: watchVideo

text: qsTrc("project/migration", "Watch video")
onClicked: dialog.watchVideo()
}
appVersion: dialog.appVersion
isAskAgain: dialog.isAskAgain

isApplyLeland: dialog.isApplyLeland
isApplyEdwin: dialog.isApplyEdwin
isApplyAutoSpacing: dialog.isApplyAutoSpacing

isPre300: dialog.migrationType === MigrationType.Pre300

navigationSection: dialog.navigationSection

onIsAskAgainChangeRequested: {
dialog.isAskAgain = !dialog.isAskAgain
}

onWatchVideoRequested: {
dialog.watchVideo()
}

Item {
id: footer

anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.leftMargin: 16
anchors.rightMargin: 16
height: 56

Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: -16
height: 2
color: ui.theme.buttonColor
}

CheckBox {
id: askAgain
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
text: qsTrc("global", "Don't ask again")
checked: !dialog.isAskAgain
onClicked: dialog.isAskAgain = !dialog.isAskAgain
}

FlatButton {
id: applyBtn
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: qsTrc("global", "OK")
onClicked: {
dialog.ret = dialog.makeRet(true)
dialog.hide()
}
}
onAccess: {
dialog.ret = dialog.makeRet(true)
dialog.hide()
}
}
}
Expand Down
Loading

0 comments on commit 3920500

Please sign in to comment.