Merge pull request #9482 from RomanPudashkin/inspector_separators
[MU4] Fix #9245: A divider line should be placed in between sections
This commit is contained in:
commit
741cb07253
20 changed files with 209 additions and 146 deletions
|
@ -56,7 +56,6 @@ FocusScope {
|
|||
Column {
|
||||
id: contentColumn
|
||||
|
||||
height: childrenRect.height
|
||||
width: root.width
|
||||
|
||||
spacing: 12
|
||||
|
@ -69,13 +68,8 @@ FocusScope {
|
|||
id: contentLoader
|
||||
|
||||
property alias yScale: scalingFactor.yScale
|
||||
property int contentHorizontalPadding: 4
|
||||
|
||||
function getContentHeight() {
|
||||
return implicitHeight === 0 ? implicitHeight : implicitHeight + contentHorizontalPadding * 2
|
||||
}
|
||||
|
||||
height: root.isExpanded ? getContentHeight() * yScale : 0
|
||||
height: root.isExpanded ? implicitHeight : 0
|
||||
width: root.width
|
||||
|
||||
enabled: root.isExpanded
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<qresource prefix="/">
|
||||
<file>qml/MuseScore/Inspector/general/GeneralInspectorView.qml</file>
|
||||
<file>qml/MuseScore/Inspector/InspectorForm.qml</file>
|
||||
<file>qml/MuseScore/Inspector/InspectorSectionDelegate.qml</file>
|
||||
<file>qml/MuseScore/Inspector/notation/NotationMultiElementView.qml</file>
|
||||
<file>qml/MuseScore/Inspector/notation/notes/StemSettings.qml</file>
|
||||
<file>qml/MuseScore/Inspector/notation/notes/NoteSettings.qml</file>
|
||||
|
|
|
@ -26,11 +26,7 @@ import MuseScore.Ui 1.0
|
|||
import MuseScore.UiComponents 1.0
|
||||
import MuseScore.Inspector 1.0
|
||||
|
||||
import "common"
|
||||
import "general"
|
||||
import "notation"
|
||||
import "text"
|
||||
import "score"
|
||||
import "."
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
@ -75,128 +71,43 @@ Rectangle {
|
|||
|
||||
Column {
|
||||
id: contentColumn
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: 12
|
||||
|
||||
height: childrenRect.height
|
||||
spacing: 6
|
||||
spacing: 12
|
||||
|
||||
Repeater {
|
||||
id: inspectorRepeater
|
||||
model: InspectorListModel {}
|
||||
|
||||
delegate: ExpandableBlank {
|
||||
id: expandableDelegate
|
||||
model: InspectorListModel {
|
||||
id: inspectorListModel
|
||||
}
|
||||
|
||||
required property int index
|
||||
required property var inspectorSectionModel // Comes from inspectorListModel
|
||||
delegate: Column {
|
||||
width: parent.width
|
||||
|
||||
NavigationPanel {
|
||||
id: navPanel
|
||||
name: expandableDelegate.title
|
||||
section: root.navigationSection
|
||||
enabled: expandableDelegate.enabled && expandableDelegate.visible
|
||||
direction: NavigationPanel.Vertical
|
||||
accessible.name: expandableDelegate.title
|
||||
order: expandableDelegate.index + 2
|
||||
spacing: contentColumn.spacing
|
||||
|
||||
SeparatorLine {
|
||||
anchors.margins: -12
|
||||
|
||||
visible: model.index !== 0
|
||||
}
|
||||
|
||||
navigation.panel: navPanel
|
||||
navigation.row: 0
|
||||
InspectorSectionDelegate {
|
||||
sectionModel: model.inspectorSectionModel
|
||||
index: model.index
|
||||
anchorItem: root
|
||||
navigationSection: root.navigationSection
|
||||
|
||||
title: inspectorSectionModel.title
|
||||
|
||||
contentItemComponent: {
|
||||
switch (inspectorSectionModel.sectionType) {
|
||||
case Inspector.SECTION_GENERAL: return generalInspector
|
||||
case Inspector.SECTION_TEXT: return textInspector
|
||||
case Inspector.SECTION_NOTATION:
|
||||
if (inspectorSectionModel.isMultiModel()) {
|
||||
return notationInspectorMultiElements
|
||||
} else {
|
||||
return notationInspectorSingleElement
|
||||
}
|
||||
case Inspector.SECTION_SCORE_DISPLAY: return scoreInspector
|
||||
case Inspector.SECTION_SCORE_APPEARANCE: return scoreAppearanceInspector
|
||||
onReturnToBoundsRequested: {
|
||||
flickableArea.returnToBounds()
|
||||
}
|
||||
}
|
||||
|
||||
onContentItemComponentChanged: {
|
||||
flickableArea.returnToBounds()
|
||||
}
|
||||
|
||||
Component {
|
||||
id: generalInspector
|
||||
|
||||
GeneralInspectorView {
|
||||
model: expandableDelegate.inspectorSectionModel
|
||||
navigationPanel: navPanel
|
||||
navigationRowStart: expandableDelegate.navigation.row + 1
|
||||
anchorItem: root
|
||||
|
||||
onEnsureContentVisibleRequested: {
|
||||
flickableArea.ensureContentVisible(-invisibleContentHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: textInspector
|
||||
|
||||
TextInspectorView {
|
||||
model: expandableDelegate.inspectorSectionModel
|
||||
navigationPanel: navPanel
|
||||
navigationRowStart: expandableDelegate.navigation.row + 1
|
||||
anchorItem: root
|
||||
|
||||
onEnsureContentVisibleRequested: {
|
||||
flickableArea.ensureContentVisible(-invisibleContentHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: notationInspectorMultiElements
|
||||
|
||||
NotationMultiElementView {
|
||||
model: expandableDelegate.inspectorSectionModel
|
||||
navigationPanel: navPanel
|
||||
navigationRowStart: expandableDelegate.navigation.row + 1
|
||||
anchorItem: root
|
||||
|
||||
onEnsureContentVisibleRequested: {
|
||||
flickableArea.ensureContentVisible(-invisibleContentHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: notationInspectorSingleElement
|
||||
|
||||
NotationSingleElementView {
|
||||
model: expandableDelegate.inspectorSectionModel
|
||||
navigationPanel: navPanel
|
||||
navigationRowStart: expandableDelegate.navigation.row + 1
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: scoreInspector
|
||||
|
||||
ScoreDisplayInspectorView {
|
||||
model: expandableDelegate.inspectorSectionModel
|
||||
navigationPanel: navPanel
|
||||
navigationRowStart: expandableDelegate.navigation.row + 1
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: scoreAppearanceInspector
|
||||
|
||||
ScoreAppearanceInspectorView {
|
||||
model: expandableDelegate.inspectorSectionModel
|
||||
navigationPanel: navPanel
|
||||
navigationRowStart: expandableDelegate.navigation.row + 1
|
||||
onEnsureContentVisibleRequested: {
|
||||
flickableArea.ensureContentVisible(invisibleContentHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,159 @@
|
|||
/*
|
||||
* 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 MuseScore.Ui 1.0
|
||||
import MuseScore.UiComponents 1.0
|
||||
import MuseScore.Inspector 1.0
|
||||
|
||||
import "common"
|
||||
import "general"
|
||||
import "notation"
|
||||
import "text"
|
||||
import "score"
|
||||
|
||||
ExpandableBlank {
|
||||
id: root
|
||||
|
||||
property int index: -1
|
||||
property var sectionModel // Comes from inspectorListModel
|
||||
property var anchorItem: null
|
||||
property var navigationSection: null
|
||||
|
||||
signal returnToBoundsRequested()
|
||||
signal ensureContentVisibleRequested(int invisibleContentHeight)
|
||||
|
||||
NavigationPanel {
|
||||
id: navPanel
|
||||
name: root.title
|
||||
section: root.navigationSection
|
||||
direction: NavigationPanel.Vertical
|
||||
accessible.name: root.title
|
||||
enabled: root.enabled && root.visible
|
||||
order: root.index + 2
|
||||
}
|
||||
|
||||
navigation.panel: navPanel
|
||||
navigation.row: 0
|
||||
|
||||
title: root.sectionModel ? root.sectionModel.title : ""
|
||||
|
||||
contentItemComponent: {
|
||||
if (!root.sectionModel) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
switch (root.sectionModel.sectionType) {
|
||||
case Inspector.SECTION_GENERAL: return generalSection
|
||||
case Inspector.SECTION_TEXT: return textSection
|
||||
case Inspector.SECTION_NOTATION:
|
||||
if (sectionModel.isMultiModel()) {
|
||||
return notationMultiElementsSection
|
||||
} else {
|
||||
return notationSingleElementSection
|
||||
}
|
||||
case Inspector.SECTION_SCORE_DISPLAY: return scoreSection
|
||||
case Inspector.SECTION_SCORE_APPEARANCE: return scoreAppearanceSection
|
||||
}
|
||||
|
||||
return undefined
|
||||
}
|
||||
|
||||
onContentItemComponentChanged: {
|
||||
root.returnToBoundsRequested()
|
||||
}
|
||||
|
||||
Component {
|
||||
id: generalSection
|
||||
|
||||
GeneralInspectorView {
|
||||
model: root.sectionModel
|
||||
navigationPanel: navPanel
|
||||
navigationRowStart: root.navigation.row + 1
|
||||
anchorItem: root
|
||||
|
||||
onEnsureContentVisibleRequested: {
|
||||
root.ensureContentVisibleRequested(-invisibleContentHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: textSection
|
||||
|
||||
TextInspectorView {
|
||||
model: root.sectionModel
|
||||
navigationPanel: navPanel
|
||||
navigationRowStart: root.navigation.row + 1
|
||||
anchorItem: root
|
||||
|
||||
onEnsureContentVisibleRequested: {
|
||||
root.ensureContentVisibleRequested(-invisibleContentHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: notationMultiElementsSection
|
||||
|
||||
NotationMultiElementView {
|
||||
model: root.sectionModel
|
||||
navigationPanel: navPanel
|
||||
navigationRowStart: root.navigation.row + 1
|
||||
anchorItem: root
|
||||
|
||||
onEnsureContentVisibleRequested: {
|
||||
root.ensureContentVisibleRequested(-invisibleContentHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: notationSingleElementSection
|
||||
|
||||
NotationSingleElementView {
|
||||
model: root.sectionModel
|
||||
navigationPanel: navPanel
|
||||
navigationRowStart: root.navigation.row + 1
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: scoreSection
|
||||
|
||||
ScoreDisplayInspectorView {
|
||||
model: root.sectionModel
|
||||
navigationPanel: navPanel
|
||||
navigationRowStart: root.navigation.row + 1
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: scoreAppearanceSection
|
||||
|
||||
ScoreAppearanceInspectorView {
|
||||
model: root.sectionModel
|
||||
navigationPanel: navPanel
|
||||
navigationRowStart: root.navigation.row + 1
|
||||
}
|
||||
}
|
||||
}
|
|
@ -52,7 +52,7 @@ Column {
|
|||
navigationRowStart: 0
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
VerticalSpacingSection {
|
||||
id: verticalSpacingSection
|
||||
|
@ -63,7 +63,7 @@ Column {
|
|||
navigationRowStart: horizontalSpacingSection.navigationRowEnd + 1
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
AppearanceOffsetSection {
|
||||
id: offsetSection
|
||||
|
@ -88,7 +88,7 @@ Column {
|
|||
}
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
ArrangeSection {
|
||||
id: arrangeSection
|
||||
|
@ -109,7 +109,7 @@ Column {
|
|||
}
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
ColorSection {
|
||||
propertyItem: root.model ? root.model.color : null
|
||||
|
|
|
@ -99,9 +99,7 @@ Column {
|
|||
propertyItem: root.barlineSettingsModel ? root.barlineSettingsModel.isSpanToNextStaff : null
|
||||
}
|
||||
|
||||
SeparatorLine {
|
||||
anchors.margins: -10
|
||||
}
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
Item {
|
||||
height: childrenRect.height
|
||||
|
|
|
@ -59,7 +59,7 @@ Column {
|
|||
navigationRowStart: root.navigationRowStart + 1
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
HorizontalGapsSection {
|
||||
id: horizontalGapsSection
|
||||
|
@ -70,7 +70,7 @@ Column {
|
|||
navigationRowStart: widthSection.navigationRowEnd + 1
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
CheckBoxPropertyView {
|
||||
text: qsTrc("inspector", "Display key, brackets and braces")
|
||||
|
|
|
@ -51,7 +51,7 @@ Column {
|
|||
navigationRowStart: root.navigationRowStart + 1
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
HorizontalMarginsSection {
|
||||
id: horizontalMarginsSection
|
||||
|
|
|
@ -59,7 +59,7 @@ Column {
|
|||
navigationRowStart: root.navigationRowStart + 1
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
VerticalGapsSection {
|
||||
id: verticalGapsSection
|
||||
|
@ -70,7 +70,7 @@ Column {
|
|||
navigationRowStart: heightSection.navigationRowEnd + 1
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
HorizontalMarginsSection {
|
||||
id: horizontalMargindSection
|
||||
|
|
|
@ -104,7 +104,7 @@ Column {
|
|||
}
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
CheckBoxPropertyView {
|
||||
text: qsTrc("inspector", "Scale to frame size")
|
||||
|
|
|
@ -86,7 +86,7 @@ Column {
|
|||
navigation.row: lineTypeSectuion.navigationRowEnd + 1
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
LineStyleSection {
|
||||
lineStyle: root.model ? root.model.lineStyle : null
|
||||
|
|
|
@ -54,7 +54,7 @@ Column {
|
|||
navigationRowStart: root.navigationRowStart
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
PlacementSection {
|
||||
propertyItem: root.model ? root.model.placement : null
|
||||
|
|
|
@ -87,7 +87,7 @@ FocusableItem {
|
|||
navigationRowStart: root.navigationRowStart + 3
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
Item {
|
||||
height: childrenRect.height
|
||||
|
|
|
@ -65,7 +65,7 @@ FocusableItem {
|
|||
navigationRowStart: beginningTextSection.navigationRowEnd + 1
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
TextSection {
|
||||
id: continiousTextSection
|
||||
|
@ -85,7 +85,7 @@ FocusableItem {
|
|||
navigationRowStart: continiousTextSection.navigationRowEnd + 1
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10; visible: endTextSection.visible }
|
||||
SeparatorLine { anchors.margins: -12; visible: endTextSection.visible }
|
||||
|
||||
TextSection {
|
||||
id: endTextSection
|
||||
|
|
|
@ -75,7 +75,7 @@ Column {
|
|||
navigationRowStart: root.navigationRowStart + 3
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
LineStyleSection {
|
||||
id: lineStyleSection
|
||||
|
@ -87,7 +87,7 @@ Column {
|
|||
navigationRowStart: lineTypeSection.navigationRowEnd + 1
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10; visible: placementSection.visible }
|
||||
SeparatorLine { anchors.margins: -12; visible: placementSection.visible }
|
||||
|
||||
PlacementSection {
|
||||
id: placementSection
|
||||
|
|
|
@ -66,7 +66,7 @@ FocusableItem {
|
|||
navigation.row: typeSection.navigationRowEnd + 1
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
LineWithHooksCommonStyleSettings {
|
||||
model: root.model
|
||||
|
|
|
@ -57,7 +57,7 @@ FocusableItem {
|
|||
navigationRowStart: root.navigationRowStart + 1
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
LineWithHooksCommonStyleSettings {
|
||||
model: root.model
|
||||
|
|
|
@ -66,7 +66,7 @@ FocusableItem {
|
|||
enabled: root.model ? !root.model.isEmpty : false
|
||||
|
||||
SeparatorLine {
|
||||
anchors.margins: -10
|
||||
anchors.margins: -12
|
||||
visible: featheringControlsColumn.visible
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ FocusableItem {
|
|||
}
|
||||
|
||||
SeparatorLine {
|
||||
anchors.margins: -10
|
||||
anchors.margins: -12
|
||||
visible: featheringControlsColumn.visible
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ Column {
|
|||
}
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
Item {
|
||||
height: childrenRect.height
|
||||
|
@ -173,7 +173,7 @@ Column {
|
|||
navigationRowStart: invisibleStaffLinesCheckBox.navigation.row + 1
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
DropdownPropertyView {
|
||||
id: noteHeadScheme
|
||||
|
|
|
@ -222,7 +222,7 @@ Column {
|
|||
maxValue: 5
|
||||
}
|
||||
|
||||
SeparatorLine { anchors.margins: -10 }
|
||||
SeparatorLine { anchors.margins: -12 }
|
||||
|
||||
DropdownPropertyView {
|
||||
id: textStyleSection
|
||||
|
|
Loading…
Reference in a new issue