Skip to content

Commit

Permalink
Implemented the main inspector qml form
Browse files Browse the repository at this point in the history
  • Loading branch information
vpereverzev committed Jun 1, 2020
1 parent a536144 commit befa7a0
Showing 1 changed file with 103 additions and 0 deletions.
103 changes: 103 additions & 0 deletions inspectors/view/qml/InspectorForm.qml
@@ -0,0 +1,103 @@
import QtQuick 2.9
import QtQml.Models 2.3
import MuseScore.Inspectors 3.3

import "common"
import "general_inspector"
import "notation_inspector"

FocusableItem {
id: root

property alias inspectorListModel: presenterModel.model

Rectangle {
id: backgroundRect

anchors.fill: parent

color: globalStyle.window
}

Column {
id: tabTitleColumn

anchors.left: parent.left
anchors.leftMargin: 24

spacing: 4

StyledTextLabel {
id: inspectorTitle

text: qsTr("Inspector")
font.bold: true
font.pixelSize: globalStyle.font.pixelSize * 1.2
}

Rectangle {
id: titleHighlighting

height: 3
width: inspectorTitle.width

color: globalStyle.voice1Color

radius: 2
}
}

DelegateModel {
id: presenterModel

model: root.inspectorListModel

delegate: ExpandableBlank {

function viewByType() {

switch (inspectorData.type) {
case Inspector.GENERAL: return generalInspector
case Inspector.NOTATION: return notationInspector
}
}

contentItemComponent: viewByType()

menuItemComponent: InspectorMenu {
onResetToDefaultsRequested: {
inspectorData.requestResetToDefaults()
}
}

Component.onCompleted: {
title = inspectorData.title
}

Component { id: generalInspector; GeneralInspectorView { model: inspectorData } }
Component { id: notationInspector; NotationInspectorView { model: inspectorData } }
}
}

ListView {
id: inspectorListView

anchors.top: tabTitleColumn.bottom
anchors.topMargin: 12
anchors.left: parent.left
anchors.leftMargin: 24

height: parent.height
width: parent.width

model: presenterModel
}

FocusableItem {
id: focusChainBreak

onActiveFocusChanged: {
parent.focus = false
}
}
}

0 comments on commit befa7a0

Please sign in to comment.