From a659fe7e7818d714caacdd34487efca1d67c0ca9 Mon Sep 17 00:00:00 2001
From: SeeLook <945374+SeeLook@users.noreply.github.com>
Date: Thu, 5 Oct 2017 22:20:33 +0200
Subject: [PATCH] Get rid of main window grid, place controls manually, adjust
 to single note mode

---
 src/qml/MainWindow.qml             | 35 ++++++++++++++++++------------
 src/qml/instruments/Instrument.qml |  3 +++
 2 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/src/qml/MainWindow.qml b/src/qml/MainWindow.qml
index 489ea46c7..f4e278bfe 100644
--- a/src/qml/MainWindow.qml
+++ b/src/qml/MainWindow.qml
@@ -66,22 +66,29 @@ ApplicationWindow {
   MainMenu { id: mainMenu }
   header: mainMenu.toolBar
 
-  Grid {
-      anchors.fill: parent
-      columns: GLOB.instrument.isSax ? 2 : 1
+  MainScore {
+    id: score
+    height: nootkaWindow.height - (header ? header.height : 0) - (GLOB.instrument.isSax ? (GLOB.singleNoteMode ? instrument.height / 7 : 0) : instrument.height)
+    width: (parent.width - (GLOB.instrument.isSax ? instrument.width : 0)) / (GLOB.singleNoteMode ? 2 : 1)
+    z: 5
+  }
 
-      MainScore {
-        id: score
-        height: nootkaWindow.height - (header ? header.height : 0) - (GLOB.instrument.isSax ? 0 : instrument.height)
-        width: parent.width - (GLOB.instrument.isSax ? instrument.width : 0)
-        z: 5
-      }
+  Instrument {
+    id: instrument
+    score: score
+  }
 
-      Instrument {
-        id: instrument
-        z: 1
-        score: score
-      }
+  Loader {
+    active: GLOB.singleNoteMode
+    source: "qrc:/NoteName.qml"
+    width: score.width
+    height: score.height
+    x: score.width + 1
+    z: 5
+    onLoaded: {
+      item.note = Qt.binding(function() { return score.note })
+      item.onNoteChanged.connect(function() { score.setNote(score.scoreObj.note(0), item.note) })
+    }
   }
 
   Component.onCompleted: {
diff --git a/src/qml/instruments/Instrument.qml b/src/qml/instruments/Instrument.qml
index b68e76d3b..a9ba98d17 100644
--- a/src/qml/instruments/Instrument.qml
+++ b/src/qml/instruments/Instrument.qml
@@ -17,6 +17,9 @@ Item {
 
   height: GLOB.instrument.isSax ? parent.height : Math.max(parent.height / GLOB.instrument.heightPart, nootkaWindow.fontSize * 12)
   width: parent.width * (GLOB.instrument.isSax ? 0.15 : 1)
+  y: GLOB.instrument.isSax ? 0 : score.height + 1
+  x: GLOB.instrument.isSax ? parent.width - width : 0
+  z: 1
 
   Loader {
     id: instrLoad
-- 
GitLab