Commit ded8bf21 authored by SeeLook's avatar SeeLook 🎸
Browse files

Handle 'show notes diff' by Main Window - create component on demand

parent 7c3bf228
......@@ -7,8 +7,6 @@ import QtQuick.Controls 2.12
import Nootka 1.0
import "sound"
ApplicationWindow {
id: nootkaWindow
......@@ -29,6 +27,7 @@ ApplicationWindow {
property var tip: null
property var analyzeWindow: null
property var sndInf: null
property var notesBarItem: null
SystemPalette {
id: activPal
......@@ -64,7 +63,7 @@ ApplicationWindow {
height: nootkaWindow.contentItem.height
- (GLOB.instrument.isSax ? (GLOB.singleNoteMode ? insHi / 7 : 0) : insHi)
- (examResults ? examResults.height + 2 : 0)
- (GLOB.showNotesDiff() ? namesBarItem.height : 0)
- (notesBarItem ? notesBarItem.height : 0)
width: parent.width * (GLOB.instrument.isSax ? 0.85 : 1)
z: 5
transformOrigin: Item.Top
......@@ -76,8 +75,6 @@ ApplicationWindow {
}
}
NotesDiffBar { id: namesBarItem; visible: GLOB.showNotesDiff() }
Instrument {
id: instrument
score: score
......@@ -101,6 +98,15 @@ ApplicationWindow {
showDialog(Nootka.NoDialog)
dialogLoader.openFile(fileName)
}
onShowNotesDiffChanged: {
if (GLOB.showNotesDiff) {
if (!notesBarItem)
notesBarItem = Qt.createComponent("qrc:/sound/NotesDiffBar.qml").createObject(nootkaWindow.contentItem)
} else {
if (notesBarItem)
notesBarItem.destroy()
}
}
}
Component.onCompleted: {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment