|
| 1 | +import QtQuick 2.12 |
| 2 | +import "./funcs" |
| 3 | + |
| 4 | +Rectangle { |
| 5 | + id: smallMenu |
| 6 | + color: colorTh.base |
| 7 | + property int num_menu: 0 |
| 8 | + |
| 9 | + Image { |
| 10 | + id: backBut |
| 11 | + source: "qrc:/resources/" + colorTh.icon_dir + "/arrow-menu.png" |
| 12 | + width: parent.width * 0.14 |
| 13 | + height: width |
| 14 | + anchors.left: parent.left |
| 15 | + anchors.top: parent.top |
| 16 | + anchors.topMargin: width * 0.3 |
| 17 | + fillMode: Image.PreserveAspectFit |
| 18 | + |
| 19 | +// MouseArea { |
| 20 | +// anchors.fill: parent |
| 21 | +// onClicked: { |
| 22 | +// personPanel.state = "deactive" |
| 23 | +// } |
| 24 | +// } |
| 25 | + } |
| 26 | + |
| 27 | + Text { |
| 28 | + id: titleText |
| 29 | + text: getTitle(num_menu) |
| 30 | + font.family: "Segoe UI Semibold" |
| 31 | + verticalAlignment: Text.AlignVCenter |
| 32 | + horizontalAlignment: Text.AlignHCenter |
| 33 | + font.pixelSize: parent.width * 0.07 |
| 34 | + color: colorTh.contr |
| 35 | + anchors.horizontalCenter: parent.horizontalCenter |
| 36 | + anchors.verticalCenter: backBut.verticalCenter |
| 37 | + } |
| 38 | + |
| 39 | + NoReady { |
| 40 | + id: funcCont |
| 41 | + anchors.top: backBut.bottom |
| 42 | + anchors.horizontalCenter: parent.horizontalCenter |
| 43 | + width: parent.width |
| 44 | + height: parent.height - (titleText.y + titleText.height) |
| 45 | + visible: true |
| 46 | + } |
| 47 | + |
| 48 | + |
| 49 | + function getTitle(i) { |
| 50 | + switch (i) { |
| 51 | + case -4: return qsTr("Релаксация") |
| 52 | + case -3: return qsTr("Терапия\nудовольствием") |
| 53 | + case -2: return qsTr("Измени\nмышление") |
| 54 | + case -1: return qsTr("Работы\nмышления") |
| 55 | + case 1: return qsTr("Тест\nсостояния") |
| 56 | + case 2: return qsTr("Дневник\nмыслей") |
| 57 | + case 3: return qsTr("Помощь\nспециалиста") |
| 58 | + case 5: return qsTr("О приложении") |
| 59 | + default: return qsTr("Неизвестный\nпункт") |
| 60 | + } |
| 61 | + } |
| 62 | + |
| 63 | + |
| 64 | +} |
0 commit comments