Warning, /education/gcompris/src/activities/piano_composition/Staff.qml is written in an unsupported language. File is not indexed.

0001 /* GCompris - Staff.qml
0002  *
0003  * SPDX-FileCopyrightText: 2016 Johnny Jazeix <jazeix@gmail.com>
0004  * SPDX-FileCopyrightText: 2018 Aman Kumar Gupta <gupta2140@gmail.com>
0005  *
0006  * Authors:
0007  *   Beth Hadley <bethmhadley@gmail.com> (GTK+ version)
0008  *   Johnny Jazeix <jazeix@gmail.com> (Qt Quick port)
0009  *   Aman Kumar Gupta <gupta2140@gmail.com> (Qt Quick port)
0010  *
0011  *   SPDX-License-Identifier: GPL-3.0-or-later
0012  */
0013 import QtQuick 2.12
0014 import GCompris 1.0
0015 
0016 import "../../core"
0017 
0018 Item {
0019     id: staff
0020 
0021     property Item main: activity.main
0022 
0023     property int verticalDistanceBetweenLines: height / nbLines
0024 
0025     // Stave
0026     readonly property int nbLines: 5
0027 
0028     property bool lastPartition: false
0029 
0030     readonly property int yShift: activity.horizontalLayout ? 0 : 1.5
0031 
0032     Repeater {
0033         id: staffLines
0034         model: nbLines
0035         Rectangle {
0036             width: staff.width
0037             height: activity.horizontalLayout ? 5 : 3
0038             border.width: height / 2
0039             color: "black"
0040             y: index * verticalDistanceBetweenLines + yShift
0041         }
0042     }
0043 
0044     // Ending vertical line of the staff.
0045     Rectangle {
0046         id: staffEndLine
0047         width: activity.horizontalLayout ? 5 : 3
0048         border.width: width / 2
0049         height: (nbLines - 1) * verticalDistanceBetweenLines + width
0050         color: "black"
0051         x: staff.width
0052         y: yShift
0053     }
0054 
0055     // The 2nd vertical line denoting the end of multiple staves
0056     Rectangle {
0057         id: multiStaffEndLine
0058         width: activity.horizontalLayout ? 5 : 3
0059         border.width: width / 2
0060         height: (nbLines - 1) * verticalDistanceBetweenLines + width
0061         visible: lastPartition
0062         color: "black"
0063         x: staff.width - 10
0064         y: yShift
0065     }
0066 }