|
| 1 | +import QtQuick 2.12 |
| 2 | +import QtQuick.Controls 2.12 |
| 3 | + |
| 4 | +Item { |
| 5 | + id: panel |
| 6 | + |
| 7 | + AnimatedImage { |
| 8 | + id: animation |
| 9 | + source: "qrc:/resources/relax.gif" |
| 10 | + anchors.top: parent.top |
| 11 | + anchors.horizontalCenter: parent.horizontalCenter |
| 12 | + width: parent.width |
| 13 | + fillMode: Image.PreserveAspectFit |
| 14 | + } |
| 15 | + |
| 16 | + Rectangle { |
| 17 | + id: baseToDo |
| 18 | + color: colorTh.base |
| 19 | + width: parent.width |
| 20 | + height: parent.height - animation.height + animation.height * 0.3 |
| 21 | + anchors.top: animation.bottom |
| 22 | + anchors.topMargin: - animation.height * 0.2 |
| 23 | + radius: 70 |
| 24 | + |
| 25 | + Text { |
| 26 | + id: titleText |
| 27 | + text: qsTr("Чем хотите заняться?") |
| 28 | + font.family: "Segoe UI Semibold" |
| 29 | + verticalAlignment: Text.AlignVCenter |
| 30 | + horizontalAlignment: Text.AlignHCenter |
| 31 | + font.pixelSize: parent.width * 0.08 |
| 32 | + color: colorTh.contr |
| 33 | + anchors.top: parent.top |
| 34 | + anchors.topMargin: parent.height * 0.02 |
| 35 | + anchors.horizontalCenter: parent.horizontalCenter |
| 36 | + } |
| 37 | + |
| 38 | + ListView { |
| 39 | + //clip: false |
| 40 | + id: viewSettingListView |
| 41 | + anchors.top: titleText.bottom |
| 42 | + anchors.horizontalCenter: parent.horizontalCenter |
| 43 | + height: parent.width * 0.192 * modelView2.count |
| 44 | + width: parent.width |
| 45 | + model: modelView2 |
| 46 | + delegate: componentView2 |
| 47 | + interactive: false |
| 48 | + anchors.topMargin: parent.width * 0.05 |
| 49 | + } |
| 50 | + } |
| 51 | + |
| 52 | + ListModel { |
| 53 | + id: modelView2 |
| 54 | + ListElement { |
| 55 | + number: 1 |
| 56 | + title: qsTr("Игра \"Работы мышления\"") |
| 57 | + } |
| 58 | + ListElement { |
| 59 | + number: 2 |
| 60 | + title: qsTr("Игра \"Измени мышление\"") |
| 61 | + } |
| 62 | + ListElement { |
| 63 | + number: 3 |
| 64 | + title: qsTr("Терапия удовольствием") |
| 65 | + } |
| 66 | + ListElement { |
| 67 | + number: 4 |
| 68 | + title: qsTr("Релаксация") |
| 69 | + } |
| 70 | + } |
| 71 | + |
| 72 | + Component { |
| 73 | + id: componentView2 |
| 74 | + |
| 75 | + Item { |
| 76 | + height: butComponent * 1.2 |
| 77 | + width: panel.width * 0.8 |
| 78 | + //anchors.horizontalCenter: viewSettingListView.horizontalCenter |
| 79 | + |
| 80 | + Button { |
| 81 | + id: butComponent |
| 82 | + text: title |
| 83 | + height: width * 0.2 |
| 84 | + width: parent.width |
| 85 | + //anchors.centerIn: parent |
| 86 | + onClicked: { |
| 87 | + panel.clicked(number) |
| 88 | + } |
| 89 | + |
| 90 | + background: Rectangle { |
| 91 | + id: tecButDef |
| 92 | + color: butComponent.pressed ? colorTh.base_ext : colorTh.contrC |
| 93 | + radius: 10 |
| 94 | + height: butComponent.height |
| 95 | + width: butComponent.width |
| 96 | + anchors.centerIn: butComponent |
| 97 | + } |
| 98 | + |
| 99 | + contentItem: Text { |
| 100 | + text: butComponent.text |
| 101 | + color: colorTh.contr |
| 102 | + anchors.fill: tecButDef |
| 103 | + font.pixelSize: butComponent.height * 0.3 |
| 104 | + width: butComponent.width * 0.8 |
| 105 | + font.family: "Segoe UI Semilight" |
| 106 | + verticalAlignment: Text.AlignVCenter |
| 107 | + horizontalAlignment: Text.AlignHCenter |
| 108 | + } |
| 109 | + } |
| 110 | + } |
| 111 | + } |
| 112 | + |
| 113 | + signal clicked(int num) |
| 114 | + |
| 115 | +} |
0 commit comments