Simplified the canvas page
This commit is contained in:
parent
d789125a0c
commit
c342e03749
5 changed files with 205 additions and 114 deletions
|
@ -86,5 +86,7 @@
|
|||
<file>qml/Preferences/internal/FoldersSection.qml</file>
|
||||
<file>qml/Preferences/internal/ResetThemeButtonSection.qml</file>
|
||||
<file>qml/Preferences/internal/AdvancedTopSection.qml</file>
|
||||
<file>qml/Preferences/internal/ZoomSection.qml</file>
|
||||
<file>qml/Preferences/internal/ScrollPagesSection.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
85
src/appshell/qml/Preferences/internal/ScrollPagesSection.qml
Normal file
85
src/appshell/qml/Preferences/internal/ScrollPagesSection.qml
Normal file
|
@ -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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
98
src/appshell/qml/Preferences/internal/ZoomSection.qml
Normal file
98
src/appshell/qml/Preferences/internal/ZoomSection.qml
Normal file
|
@ -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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -69,6 +69,8 @@ Item {
|
|||
spacing: 20
|
||||
|
||||
MidiMappingTopPanel {
|
||||
useRemoteControl: mappingsModel.useRemoteControl
|
||||
|
||||
navigation.section: root.navigationSection
|
||||
navigation.order: root.navigationOrderStart + 1
|
||||
|
||||
|
|
Loading…
Reference in a new issue