Skip to content

Commit 77bccb9

Browse files
committed
Основные экраны доделаны. Добавлены музыкальные композиции для
"Релаксации" из панели "toDo"
1 parent 9f0a267 commit 77bccb9

File tree

8 files changed

+118
-67
lines changed

8 files changed

+118
-67
lines changed

main.qml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import "./qml-other/settings"
44
import "./qml-other/panels"
55

66
Window {
7+
id: root
78
visible: true
89
width: 1080/2.5
910
height: 2340/2.5
@@ -28,14 +29,15 @@ Window {
2829
width: parent.width
2930
height: parent.height - bar.height
3031
anchors.top: parent.top
31-
visible: false
32+
state: "active"
3233
}
3334

3435
ToDoPanel {
3536
id: toDoPanel
3637
width: parent.width
3738
height: parent.height - bar.height
3839
anchors.top: parent.top
40+
anchors.left: personPanel.right
3941
}
4042

4143
Rectangle {
@@ -67,13 +69,21 @@ Window {
6769

6870
Image {
6971
id: toDoMenu
70-
source: "qrc:/resources/" + colorTh.icon_dir + "/ToDo-off.png"
72+
source: personPanel.state != "deactive" ? "qrc:/resources/" + colorTh.icon_dir + "/ToDo-off.png"
73+
: "qrc:/resources/" + colorTh.icon_dir + "/ToDo-on.png"
7174
width: avatarMenu.width
7275
height: width
7376
anchors.verticalCenter: parent.verticalCenter
7477
anchors.right: parent.right
7578
anchors.rightMargin: parent.width/5
7679
fillMode: Image.PreserveAspectFit
80+
81+
MouseArea {
82+
anchors.fill: parent
83+
onClicked: {
84+
personPanel.state = "deactive"
85+
}
86+
}
7787
}
7888
}
7989
}

qml-other/panels/PersonPanel.qml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import QtQuick 2.12
22
import QtQuick.Controls 2.12
33

44
Item {
5+
id: personPanel
6+
57
Image {
68
id: avatar
79
source: "qrc:/resources/" + colorTh.icon_dir + "/avatar.png"
@@ -173,6 +175,34 @@ Item {
173175
}
174176
}
175177

178+
state: "active"
179+
anchors.right: root.left
180+
181+
states: [
182+
State {
183+
name: "deactive"
184+
AnchorChanges {
185+
target: personPanel
186+
anchors.right: container.left
187+
}
188+
},
189+
190+
State {
191+
name: "active"
192+
AnchorChanges {
193+
target: personPanel
194+
anchors.right: container.right
195+
}
196+
}
197+
]
198+
199+
transitions: Transition {
200+
AnchorAnimation {
201+
id: floating
202+
duration: 100
203+
}
204+
}
205+
176206
Component.onCompleted: {
177207
timeChanged()
178208
}

qml-other/panels/ToDoPanel.qml

Lines changed: 72 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,92 @@ Item {
1717
id: baseToDo
1818
color: colorTh.base
1919
width: parent.width
20-
height: parent.height - animation.height + animation.height * 0.3
20+
height: parent.height - animation.height + animation.height * 0.15
2121
anchors.top: animation.bottom
22-
anchors.topMargin: - animation.height * 0.2
23-
radius: 70
22+
anchors.topMargin: - animation.height * 0.15
23+
radius: 50
2424

2525
Text {
2626
id: titleText
2727
text: qsTr("Чем хотите заняться?")
2828
font.family: "Segoe UI Semibold"
2929
verticalAlignment: Text.AlignVCenter
3030
horizontalAlignment: Text.AlignHCenter
31-
font.pixelSize: parent.width * 0.08
31+
font.pixelSize: parent.width * 0.07
3232
color: colorTh.contr
3333
anchors.top: parent.top
3434
anchors.topMargin: parent.height * 0.02
3535
anchors.horizontalCenter: parent.horizontalCenter
3636
}
3737

38+
ListModel {
39+
id: modelView2
40+
ListElement {
41+
// @disable-check M16
42+
number: 1
43+
// @disable-check M16
44+
title: qsTr("Игра \"Работы мышления\"")
45+
}
46+
ListElement {
47+
// @disable-check M16
48+
number: 2
49+
// @disable-check M16
50+
title: qsTr("Игра \"Измени мышление\"")
51+
}
52+
ListElement {
53+
// @disable-check M16
54+
number: 3
55+
// @disable-check M16
56+
title: qsTr("Терапия удовольствием")
57+
}
58+
ListElement {
59+
// @disable-check M16
60+
number: 4
61+
// @disable-check M16
62+
title: qsTr("Релаксация")
63+
}
64+
}
65+
66+
Component {
67+
id: componentView2
68+
69+
Item {
70+
height: width * 0.2
71+
width: panel.width
72+
73+
Button {
74+
id: butComponent
75+
text: title
76+
height: parent.height * 0.75
77+
width: parent.width * 0.8
78+
anchors.horizontalCenter: parent.horizontalCenter
79+
onClicked: {
80+
panel.clicked(number)
81+
}
82+
83+
background: Rectangle {
84+
id: tecButDef
85+
color: butComponent.pressed ? colorTh.base_ext : colorTh.contrC
86+
radius: 10
87+
height: butComponent.height
88+
width: butComponent.width
89+
anchors.centerIn: butComponent
90+
}
91+
92+
contentItem: Text {
93+
text: butComponent.text
94+
color: colorTh.contr
95+
anchors.fill: tecButDef
96+
font.pixelSize: butComponent.height * 0.25
97+
width: butComponent.width * 0.8
98+
font.family: "Segoe UI Semilight"
99+
verticalAlignment: Text.AlignVCenter
100+
horizontalAlignment: Text.AlignHCenter
101+
}
102+
}
103+
}
104+
}
105+
38106
ListView {
39107
//clip: false
40108
id: viewSettingListView
@@ -49,67 +117,6 @@ Item {
49117
}
50118
}
51119

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-
113120
signal clicked(int num)
114121

115122
}

qml.qrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,9 @@
1717
<file>resources/music.gif</file>
1818
<file>resources/relax.gif</file>
1919
<file>resources/WhatIsDepress.mp4</file>
20+
<file>resources/RelaxMusic/Enigma - Sadeness.mp3</file>
21+
<file>resources/RelaxMusic/Ennio Morricone - Chi Mai.mp3</file>
22+
<file>resources/RelaxMusic/Weathertunes - Sunny Day (Lemongrass Lazy Afternoon).mp3</file>
23+
<file>resources/RelaxMusic/Weber - In This Dream.mp3</file>
2024
</qresource>
2125
</RCC>
6.69 MB
Binary file not shown.
8.83 MB
Binary file not shown.
Binary file not shown.
13.1 MB
Binary file not shown.

0 commit comments

Comments
 (0)