diff --git a/src/framework/uicomponents/qml/MuseScore/UiComponents/ExpandableBlank.qml b/src/framework/uicomponents/qml/MuseScore/UiComponents/ExpandableBlank.qml index 651df0d355..0967feb151 100644 --- a/src/framework/uicomponents/qml/MuseScore/UiComponents/ExpandableBlank.qml +++ b/src/framework/uicomponents/qml/MuseScore/UiComponents/ExpandableBlank.qml @@ -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 diff --git a/src/inspector/view/inspector_resources.qrc b/src/inspector/view/inspector_resources.qrc index 1a2b29454a..0b56a648ac 100644 --- a/src/inspector/view/inspector_resources.qrc +++ b/src/inspector/view/inspector_resources.qrc @@ -2,6 +2,7 @@ qml/MuseScore/Inspector/general/GeneralInspectorView.qml qml/MuseScore/Inspector/InspectorForm.qml + qml/MuseScore/Inspector/InspectorSectionDelegate.qml qml/MuseScore/Inspector/notation/NotationMultiElementView.qml qml/MuseScore/Inspector/notation/notes/StemSettings.qml qml/MuseScore/Inspector/notation/notes/NoteSettings.qml diff --git a/src/inspector/view/qml/MuseScore/Inspector/InspectorForm.qml b/src/inspector/view/qml/MuseScore/Inspector/InspectorForm.qml index 7e06c8db48..a759d111f0 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/InspectorForm.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/InspectorForm.qml @@ -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) } } } diff --git a/src/inspector/view/qml/MuseScore/Inspector/InspectorSectionDelegate.qml b/src/inspector/view/qml/MuseScore/Inspector/InspectorSectionDelegate.qml new file mode 100644 index 0000000000..07f0386cd0 --- /dev/null +++ b/src/inspector/view/qml/MuseScore/Inspector/InspectorSectionDelegate.qml @@ -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 . + */ +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 + } + } +} diff --git a/src/inspector/view/qml/MuseScore/Inspector/general/appearance/AppearanceSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/general/appearance/AppearanceSettings.qml index cce22a58a7..6f794dc610 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/general/appearance/AppearanceSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/general/appearance/AppearanceSettings.qml @@ -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 diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/barlines/BarlineSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/barlines/BarlineSettings.qml index 5995611602..cb4085b781 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/barlines/BarlineSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/barlines/BarlineSettings.qml @@ -99,9 +99,7 @@ Column { propertyItem: root.barlineSettingsModel ? root.barlineSettingsModel.isSpanToNextStaff : null } - SeparatorLine { - anchors.margins: -10 - } + SeparatorLine { anchors.margins: -12 } Item { height: childrenRect.height diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/frames/HorizontalFrameSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/frames/HorizontalFrameSettings.qml index 0a18c374db..6b28604239 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/frames/HorizontalFrameSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/frames/HorizontalFrameSettings.qml @@ -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") diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/frames/TextFrameSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/frames/TextFrameSettings.qml index 051bf9ef89..4dc9c64978 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/frames/TextFrameSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/frames/TextFrameSettings.qml @@ -51,7 +51,7 @@ Column { navigationRowStart: root.navigationRowStart + 1 } - SeparatorLine { anchors.margins: -10 } + SeparatorLine { anchors.margins: -12 } HorizontalMarginsSection { id: horizontalMarginsSection diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/frames/VerticalFrameSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/frames/VerticalFrameSettings.qml index e7f638b7ec..b3c795c329 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/frames/VerticalFrameSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/frames/VerticalFrameSettings.qml @@ -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 diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/images/ImageSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/images/ImageSettings.qml index 4ce0f3ae08..a0a8a2d11f 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/images/ImageSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/images/ImageSettings.qml @@ -104,7 +104,7 @@ Column { } } - SeparatorLine { anchors.margins: -10 } + SeparatorLine { anchors.margins: -12 } CheckBoxPropertyView { text: qsTrc("inspector", "Scale to frame size") diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/PedalSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/PedalSettings.qml index dc23e672ce..b0b508ad1f 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/PedalSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/PedalSettings.qml @@ -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 diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/VibratoSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/VibratoSettings.qml index 0ef71b786b..356b6a880c 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/VibratoSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/VibratoSettings.qml @@ -54,7 +54,7 @@ Column { navigationRowStart: root.navigationRowStart } - SeparatorLine { anchors.margins: -10 } + SeparatorLine { anchors.margins: -12 } PlacementSection { propertyItem: root.model ? root.model.placement : null diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/HairpinStyleSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/HairpinStyleSettings.qml index a96a6ca0a4..cede663e59 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/HairpinStyleSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/HairpinStyleSettings.qml @@ -87,7 +87,7 @@ FocusableItem { navigationRowStart: root.navigationRowStart + 3 } - SeparatorLine { anchors.margins: -10 } + SeparatorLine { anchors.margins: -12 } Item { height: childrenRect.height diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/LineTextSettingsTab.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/LineTextSettingsTab.qml index e999e51d83..c585633b98 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/LineTextSettingsTab.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/LineTextSettingsTab.qml @@ -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 diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/LineWithHooksCommonStyleSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/LineWithHooksCommonStyleSettings.qml index 4d9c6cd52d..8859520cf1 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/LineWithHooksCommonStyleSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/LineWithHooksCommonStyleSettings.qml @@ -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 diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/OttavaStyleSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/OttavaStyleSettings.qml index c8dae1d084..ba2f8f90da 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/OttavaStyleSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/OttavaStyleSettings.qml @@ -66,7 +66,7 @@ FocusableItem { navigation.row: typeSection.navigationRowEnd + 1 } - SeparatorLine { anchors.margins: -10 } + SeparatorLine { anchors.margins: -12 } LineWithHooksCommonStyleSettings { model: root.model diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/VoltaStyleSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/VoltaStyleSettings.qml index bf6b4f4e3d..30cca0673b 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/VoltaStyleSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/VoltaStyleSettings.qml @@ -57,7 +57,7 @@ FocusableItem { navigationRowStart: root.navigationRowStart + 1 } - SeparatorLine { anchors.margins: -10 } + SeparatorLine { anchors.margins: -12 } LineWithHooksCommonStyleSettings { model: root.model diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/notes/BeamSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/notes/BeamSettings.qml index 15fbd00583..37b96065df 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/notes/BeamSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/notes/BeamSettings.qml @@ -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 } diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/stafftype/StaffTypeSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/stafftype/StaffTypeSettings.qml index d4bf8f9f42..d678ec4529 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/notation/stafftype/StaffTypeSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/notation/stafftype/StaffTypeSettings.qml @@ -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 diff --git a/src/inspector/view/qml/MuseScore/Inspector/text/TextSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/text/TextSettings.qml index 7f1fb80e47..657cac9c01 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/text/TextSettings.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/text/TextSettings.qml @@ -222,7 +222,7 @@ Column { maxValue: 5 } - SeparatorLine { anchors.margins: -10 } + SeparatorLine { anchors.margins: -12 } DropdownPropertyView { id: textStyleSection