Skip to content

Commit e4cac41

Browse files
committed
Добавление FuncDisplay.qml и окна с информацией о том, что данная
функция еще не готова. Так же теперь можно просмотреть видео. Добавлен резервный файл с информацией о ресурсах для облегчения сборки.
1 parent 8077ef8 commit e4cac41

File tree

11 files changed

+190
-1
lines changed

11 files changed

+190
-1
lines changed

Lab.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ DEFINES += QT_DEPRECATED_WARNINGS
1616
SOURCES += \
1717
main.cpp
1818

19-
RESOURCES += qml.qrc
19+
RESOURCES += qml2.qrc
2020

2121
TRANSLATIONS += \
2222
Lab_ru_RU.ts

main.qml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import QtQuick 2.12
22
import QtQuick.Window 2.12
3+
import QtMultimedia 5.12
34
import "./qml-other/settings"
45
import "./qml-other/panels"
6+
import "./qml-other/funcionality"
57

68
Window {
79
id: root
@@ -86,5 +88,63 @@ Window {
8688
}
8789
}
8890
}
91+
92+
FuncDisplay {
93+
id: funcDisp
94+
width: parent.width
95+
height: parent.height
96+
anchors.top: parent.top
97+
//anchors.right: parent.left
98+
anchors.horizontalCenter: parent.horizontalCenter
99+
}
100+
101+
Rectangle {
102+
id: videoPlayer
103+
width: parent.width
104+
height: parent.height
105+
anchors.centerIn: parent
106+
color: colorTh.shadow
107+
visible: false
108+
109+
function run() {
110+
visible = true
111+
player.play()
112+
}
113+
114+
Video {
115+
id: player
116+
width: parent.width
117+
height: width
118+
anchors.centerIn: parent
119+
fillMode: Image.PreserveAspectFit
120+
source: "file:///D:/video.mp4"
121+
autoPlay: false
122+
autoLoad: true
123+
onStopped: {
124+
videoPlayer.visible = false
125+
}
126+
}
127+
128+
Text {
129+
text: qsTr("Нажмите в любую точку экрна,\nчтобы прервать воспроизведение")
130+
font.family: "Segoe UI Semibold"
131+
verticalAlignment: Text.AlignVCenter
132+
horizontalAlignment: Text.AlignHCenter
133+
font.pixelSize: parent.width * 0.05
134+
color: colorTh.contr
135+
anchors.top: player.bottom
136+
anchors.topMargin: height/2
137+
anchors.horizontalCenter: parent.horizontalCenter
138+
}
139+
140+
MouseArea {
141+
anchors.fill: parent
142+
onClicked: {
143+
player.stop()
144+
videoPlayer.visible = false
145+
}
146+
}
147+
}
148+
89149
}
90150
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import QtQuick 2.0
2+
3+
Item {
4+
5+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import QtQuick 2.0
2+
3+
Item {
4+
5+
Text {
6+
id: sorryText
7+
text: qsTr("Упс! Этой функции еще пока нет.\nНе переживайте, мы скоро всё\nсделаем!\nЗаварите себе кружку\nкофе, пока мы работаем")
8+
font.family: "Segoe UI Semibold"
9+
verticalAlignment: Text.AlignVCenter
10+
horizontalAlignment: Text.AlignHCenter
11+
font.pixelSize: parent.width * 0.05
12+
color: colorTh.contr
13+
anchors.horizontalCenter: parent.horizontalCenter
14+
anchors.top: parent.top
15+
anchors.topMargin: height/5
16+
}
17+
18+
Image {
19+
id: name
20+
source: "qrc:/resources/coffe.png"
21+
width: parent.width * 0.4
22+
height: width
23+
anchors.top: sorryText.bottom
24+
anchors.topMargin: height * 0.1
25+
anchors.horizontalCenter: parent.horizontalCenter
26+
fillMode: Image.PreserveAspectFit
27+
}
28+
}

qml-other/panels/PersonPanel.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ Item {
120120
anchors.fill: parent
121121
onClicked: {
122122
personPanel.clicked(index)
123+
if (index == 0) {
124+
videoPlayer.run()
125+
}
123126
}
124127
}
125128
}

qml-other/settings/ColorTheme.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Item {
77
property color base_ext: "#404040"
88
property color contr: "#447C4F"
99
property color contrC: "white"
10+
property color shadow: Qt.rgba(0, 0, 0, 0.5)
1011
property string icon_dir: "blackTh"
1112

1213
state: colorThemesSet.selected
@@ -26,6 +27,7 @@ Item {
2627
base_ext: "#404040"
2728
contr: "#447C4F"
2829
contrC: "white"
30+
shadow: Qt.rgba(0, 0, 0, 0.5)
2931
icon_dir: "blackTh"
3032
}
3133
},
@@ -38,6 +40,7 @@ Item {
3840
base_ext: "#C6C6C6"
3941
contr: "#005D77"
4042
contrC: "black"
43+
shadow: Qt.rgba(100, 100, 100, 0.5)
4144
icon_dir: "whiteTh"
4245
}
4346
}

qml2.qrc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<RCC>
2+
<qresource prefix="/">
3+
<file>main.qml</file>
4+
<file>qml-other/begin-menu/BeginMenu.qml</file>
5+
<file>qml-other/panels/PersonPanel.qml</file>
6+
<file>qml-other/panels/ToDoPanel.qml</file>
7+
<file>qml-other/settings/SaveSet.qml</file>
8+
<file>qml-other/settings/ColorTheme.qml</file>
9+
<file>resources/blackTh/avatar.png</file>
10+
<file>resources/whiteTh/avatar.png</file>
11+
<file>resources/blackTh/avatar-off.png</file>
12+
<file>resources/blackTh/ToDo-off.png</file>
13+
<file>resources/blackTh/ToDo-on.png</file>
14+
<file>resources/whiteTh/avatar-off.png</file>
15+
<file>resources/whiteTh/ToDo-off.png</file>
16+
<file>resources/whiteTh/ToDo-on.png</file>
17+
<file>resources/music.gif</file>
18+
<file>resources/relax.gif</file>
19+
<file>qml-other/funcionality/FuncDisplay.qml</file>
20+
<file>qml-other/funcionality/funcs/MusicPlayer.qml</file>
21+
<file>resources/blackTh/arrow-menu.png</file>
22+
<file>resources/whiteTh/arrow-menu.png</file>
23+
<file>qml-other/funcionality/funcs/NoReady.qml</file>
24+
<file>resources/coffe.png</file>
25+
</qresource>
26+
</RCC>

resources/blackTh/arrow-menu.png

18.9 KB
Loading

resources/coffe.png

199 KB
Loading

0 commit comments

Comments
 (0)