Skip to content

Commit 255283c

Browse files
committed
workoutview is working, fixes to main menu
1 parent 7dd42ee commit 255283c

14 files changed

+164
-152
lines changed

HighlightedText.qml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import QtQuick 2.0
2+
3+
Rectangle {
4+
property string text;
5+
property int textPadding: 20;
6+
7+
id: rect
8+
color: "#42f480"
9+
anchors.horizontalCenter: parent.horizontalCenter
10+
width: txt.width + textPadding
11+
height: txt.height + textPadding
12+
13+
Text {
14+
id: txt
15+
anchors.top: parent.top
16+
anchors.left: parent.left
17+
anchors.margins: rect.textPadding / 2
18+
text: rect.text.toUpperCase()
19+
}
20+
}

MainMenu.qml

+28-9
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,20 @@ Rectangle {
1414
anchors.top: parent.top
1515
anchors.left: parent.left
1616
anchors.right: parent.right
17-
height: parent.height*0.5
18-
color: "red"
17+
anchors.margins: 20
18+
height: parent.height * 0.5 - anchors.margins*2
19+
color: "#42f480"
20+
clip: true
1921

2022
Row {
2123
width: parent.width * 0.8
2224
anchors.horizontalCenter: parent.horizontalCenter
2325
anchors.verticalCenter: parent.verticalCenter
2426

2527
Image {
26-
source: "icons/add_black.png"
27-
width: 100
28-
height: 100
28+
source: "icons/fitness_black_2x.png"
29+
width: workoutListLink.width * 0.2 > 100 ? 100: workoutListLink.width * 0.2
30+
height: width
2931
}
3032

3133
Text{
@@ -36,27 +38,37 @@ Rectangle {
3638
}
3739

3840
MouseArea{
41+
id: workoutMa
3942
anchors.fill: parent
43+
hoverEnabled: true
44+
cursorShape: workoutMa.containsMouse ? Qt.PointingHandCursor: Qt.ArrowCursor
45+
46+
onEntered: workoutListLink.color = "#39ce6d"
47+
onExited: workoutListLink.color = "#42f480"
48+
4049
onClicked: mainStack.push(workoutListViewComponent)
4150
}
4251
}
4352

4453
Rectangle {
54+
id: blogLink
4555
anchors.top: workoutListLink.bottom
4656
anchors.left: parent.left
4757
anchors.right: parent.right
4858
anchors.bottom: parent.bottom
49-
color:"blue"
59+
anchors.margins: 20
60+
color: "#42f480"
61+
clip: true
5062

5163
Row {
5264
width: parent.width * 0.8
5365
anchors.horizontalCenter: parent.horizontalCenter
5466
anchors.verticalCenter: parent.verticalCenter
5567

5668
Image {
57-
source: "icons/menu_black.png"
58-
width: 100
59-
height: 100
69+
source: "icons/log_black_2x.png"
70+
width: blogLink.width * 0.2 > 100 ? 100: blogLink.width * 0.2
71+
height: width
6072
}
6173

6274
Text{
@@ -69,7 +81,14 @@ Rectangle {
6981
}
7082

7183
MouseArea{
84+
id: postMa
7285
anchors.fill: parent
86+
hoverEnabled: true
87+
cursorShape: postMa.containsMouse ? Qt.PointingHandCursor: Qt.ArrowCursor
88+
89+
onEntered: blogLink.color = "#39ce6d"
90+
onExited: blogLink.color = "#42f480"
91+
7392
onClicked: mainStack.push(postListViewComponent)
7493
}
7594
}

PostListView.qml

+15-19
Original file line numberDiff line numberDiff line change
@@ -159,34 +159,30 @@ Rectangle {
159159
subtitle: "Diary posts"
160160
Layout.preferredWidth: parent.width
161161

162-
ToolImageButton {
163-
id: goBackButton
164-
anchors.right: statsButton.left
165-
imgSrc: "icons/back_black.png"
162+
// ToolImageButton {
163+
// id: statsButton
164+
// anchors.right: addNewButton.left
165+
// imgSrc: "icons/stats_black.png"
166166

167-
onClicked: {
168-
mainStack.pop();
169-
}
170-
}
167+
// onClicked: {
171168

172-
ToolImageButton {
173-
id: statsButton
174-
anchors.right: addNewButton.left
175-
imgSrc: "icons/stats_black.png"
169+
// }
170+
// }
176171

177-
onClicked: {
172+
ToolImageButton {
173+
id: addNewButton
174+
anchors.right: goBackButton.left
175+
imgSrc: "icons/add_black.png"
178176

179-
}
177+
onClicked: mainStack.push(comp_addPostView)
180178
}
181179

182180
ToolImageButton {
183-
id: addNewButton
181+
id: goBackButton
184182
anchors.right: parent.right
185-
imgSrc: "icons/add_black.png"
183+
imgSrc: "icons/menu_black.png"
186184

187-
onClicked: {
188-
mainStack.push(comp_addPostView);
189-
}
185+
onClicked: mainStack.pop()
190186
}
191187

192188
}

WorkoutListView.qml

+10-4
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,24 @@ Rectangle {
114114
cursorShape: ma.containsMouse ? Qt.PointingHandCursor: Qt.ArrowCursor
115115

116116
onClicked: {
117+
var photos = [];
118+
for (var i=0; i<images.count; i++)
119+
photos.push(images.get(i));
120+
117121
var intent = {
118122
"item": workoutViewComponent,
119123
"properties": {
120124
"postIndex": index,
121125
"title": title,
122-
"category":category,
123-
"photos":images,
124-
"preparation":preparation,
125-
"execution":execution
126+
"category": category,
127+
"photos": photos,
128+
"preparation": preparation,
129+
"execution": execution
126130
}
127131
}
128132

133+
console.log(JSON.stringify(images, null, 2));
134+
129135
mainStack.push(intent);
130136
}
131137
}

0 commit comments

Comments
 (0)