Changeset View
Changeset View
Standalone View
Standalone View
src/app/plugins/GuitarView/FretBoard.qml
- This file was added.
| 1 | import QtQuick 2.7 | ||||
|---|---|---|---|---|---|
| 2 | | ||||
| 3 | Rectangle { | ||||
| 4 | id: fretBoard | ||||
| 5 | height: (string1.height + string1.anchors.topMargin) * 6 + string1.anchors.topMargin | ||||
| 6 | color: "#4b3020" | ||||
| 7 | property double string_size: 3 | ||||
| 8 | property string string_color: "#FFF2E6" | ||||
| 9 | property bool show_fret_marker: false | ||||
| 10 | property bool show_two_markers: false | ||||
| 11 | property bool is_nut: false | ||||
| 12 | property bool is_end: false | ||||
| 13 | | ||||
| 14 | Rectangle { | ||||
| 15 | id: fret_marker1 | ||||
| 16 | height: 6.5 * string_size; width: height | ||||
| 17 | radius: width * 0.5 | ||||
| 18 | visible: show_fret_marker | ||||
| 19 | opacity: 0.7 | ||||
| 20 | anchors { | ||||
| 21 | horizontalCenter: parent.horizontalCenter | ||||
| 22 | horizontalCenterOffset: - string_size / 2 | ||||
| 23 | verticalCenter: parent.verticalCenter | ||||
| 24 | verticalCenterOffset: show_two_markers ? -(parent.height - (string1.y - parent.y)) / 4 : 0 | ||||
| 25 | } | ||||
| 26 | color: "#E2E2E2" | ||||
| 27 | border.width: string_size / 2 | ||||
| 28 | border.color: "#535353" | ||||
| 29 | } | ||||
| 30 | | ||||
| 31 | Rectangle { | ||||
| 32 | id: fret_marker2 | ||||
| 33 | height: fret_marker1.height; width: height | ||||
| 34 | radius: width * 0.5 | ||||
| 35 | visible: show_two_markers | ||||
| 36 | opacity: fret_marker1.opacity | ||||
| 37 | anchors { | ||||
| 38 | horizontalCenter: parent.horizontalCenter | ||||
| 39 | verticalCenter: parent.verticalCenter | ||||
| 40 | verticalCenterOffset: show_two_markers ? (parent.height - (string1.y - parent.y)) / 4 : 0 | ||||
| 41 | } | ||||
| 42 | color: "#E2E2E2" | ||||
| 43 | border.width: string_size / 2 | ||||
| 44 | border.color: "#535353" | ||||
| 45 | } | ||||
| 46 | | ||||
| 47 | Rectangle { | ||||
| 48 | id: string1 | ||||
| 49 | width: parent.width; height: string_size | ||||
| 50 | anchors { left: parent.left; top: parent.top; topMargin: 3 * height} | ||||
| 51 | color: string_color | ||||
| 52 | } | ||||
| 53 | | ||||
| 54 | Rectangle { | ||||
| 55 | id: string2 | ||||
| 56 | width: parent.width; height: string_size | ||||
| 57 | anchors { left: parent.left; top: string1.bottom; topMargin: 3 * height} | ||||
| 58 | color: string_color | ||||
| 59 | } | ||||
| 60 | Rectangle { | ||||
| 61 | id: string3 | ||||
| 62 | width: parent.width; height: string_size | ||||
| 63 | anchors { left: parent.left; top: string2.bottom; topMargin: 3 * height} | ||||
| 64 | color: string_color | ||||
| 65 | } | ||||
| 66 | Rectangle { | ||||
| 67 | id: string4 | ||||
| 68 | width: parent.width; height: string_size | ||||
| 69 | anchors { left: parent.left; top: string3.bottom; topMargin: 3 * height} | ||||
| 70 | color: string_color | ||||
| 71 | } | ||||
| 72 | Rectangle { | ||||
| 73 | id: string5 | ||||
| 74 | width: parent.width; height: string_size | ||||
| 75 | anchors { left: parent.left; top: string4.bottom; topMargin: 3 * height} | ||||
| 76 | color: string_color | ||||
| 77 | } | ||||
| 78 | Rectangle { | ||||
| 79 | id: string6 | ||||
| 80 | width: parent.width; height: string_size | ||||
| 81 | anchors { left: parent.left; top: string5.bottom; topMargin: 3 * height} | ||||
| 82 | color: string_color | ||||
| 83 | } | ||||
| 84 | | ||||
| 85 | Rectangle { | ||||
| 86 | id: rightBar | ||||
| 87 | width: is_nut ? string_size * 4 : string_size; height: parent.height | ||||
| 88 | anchors {right: parent.right; top: parent.top; bottom: parent.bottom} | ||||
| 89 | visible: is_end ? false : true | ||||
| 90 | color: "#D9D9D9" | ||||
| 91 | } | ||||
| 92 | } | ||||