Skip to content

Commit 9f0a267

Browse files
committed
Продолжение работы с ToDoPanel.qml
1 parent 3d290e5 commit 9f0a267

File tree

6 files changed

+131
-0
lines changed

6 files changed

+131
-0
lines changed

main.qml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ Window {
2828
width: parent.width
2929
height: parent.height - bar.height
3030
anchors.top: parent.top
31+
visible: false
32+
}
33+
34+
ToDoPanel {
35+
id: toDoPanel
36+
width: parent.width
37+
height: parent.height - bar.height
38+
anchors.top: parent.top
3139
}
3240

3341
Rectangle {

qml-other/begin-menu/BeginMenu.qml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import QtQuick 2.12
2+
3+
Item {
4+
5+
6+
}

qml-other/panels/ToDoPanel.qml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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+
}

qml.qrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<file>resources/whiteTh/avatar-off.png</file>
1515
<file>resources/whiteTh/ToDo-off.png</file>
1616
<file>resources/whiteTh/ToDo-on.png</file>
17+
<file>resources/music.gif</file>
18+
<file>resources/relax.gif</file>
1719
<file>resources/WhatIsDepress.mp4</file>
1820
</qresource>
1921
</RCC>

resources/music.gif

2.55 MB
Loading

resources/relax.gif

5.52 MB
Loading

0 commit comments

Comments
 (0)