Skip to content

Commit 85cf7f4

Browse files
committed
Navigazione migliorata
1 parent 6c5211c commit 85cf7f4

File tree

3 files changed

+96
-75
lines changed

3 files changed

+96
-75
lines changed

MobileClient/QtProject/src/Panel_NearbySpots.qml

Lines changed: 12 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import QtQuick.Controls 1.1
1515

1616
// Project imports -------------------------
1717
import "qrc:/views"
18-
import "qrc:/widgets"
18+
import "qrc:/pages-spot"
1919

2020
Item {
2121

@@ -52,77 +52,6 @@ Item {
5252
// TODO if current location not valid hc_LocationManager.isValid then display waiting animation
5353
}
5454

55-
// Components --------------------------
56-
Component {
57-
id: component_SpotOverview
58-
59-
Item {
60-
id: root
61-
width: parent.width
62-
height: rectangle_Top.height
63-
+ image_Picture1.height
64-
65-
signal spotClicked
66-
67-
Rectangle {
68-
id: rectangle_Top
69-
anchors.top: parent.top
70-
width: parent.width
71-
height: 40
72-
color: "#aaaaaa"
73-
Text{
74-
id: text_SpotName
75-
anchors.leftMargin: 2
76-
width: parent.width / 2
77-
height: parent.height / 2
78-
text: role_SpotName
79-
}
80-
Text {
81-
anchors.top: parent.top
82-
anchors.left: text_SpotName.right
83-
anchors.rightMargin: 2
84-
width: text_SpotName.width
85-
height: text_SpotName.height
86-
horizontalAlignment: Text.AlignRight
87-
text: role_SpotDistance
88-
}
89-
MouseArea {
90-
anchors.fill: parent
91-
onClicked: {
92-
spotClicked();
93-
}
94-
}
95-
}
96-
CachedPicture {
97-
id: image_Picture1
98-
anchors.top: rectangle_Top.bottom
99-
width: parent.width/2
100-
height: parent.width/2
101-
sourceUrl: role_SpotPictureUrl1
102-
MouseArea {
103-
anchors.fill: parent
104-
onClicked: {
105-
spotClicked();
106-
}
107-
}
108-
}
109-
CachedPicture {
110-
id: image_Picture2
111-
anchors.top: rectangle_Top.bottom
112-
anchors.left: image_Picture1.right
113-
width: parent.width/2
114-
height: parent.width/2
115-
sourceUrl: role_SpotPictureUrl2
116-
MouseArea {
117-
anchors.fill: parent
118-
onClicked: {
119-
spotClicked();
120-
}
121-
}
122-
}
123-
}
124-
}
125-
12655
// Gui ---------------------------------
12756
Navigator{
12857
id: navigator
@@ -158,12 +87,20 @@ Item {
15887

15988
title: qsTr('Nearby spots')
16089

161-
ListView {
162-
id: listView_SpotsOverview
90+
Page_SpotsList {
16391
width: parent.width
16492
height: parent.height
16593
model: wa_NearbySpotModel
166-
delegate: component_SpotOverview
94+
onSpotClicked: {
95+
stackView.push({item: Qt.resolvedUrl("pages-spot/Page_Spot.qml"),
96+
properties:{width:stackView.width,
97+
height:stackView.height,
98+
stackView:stackView,
99+
navigator:navigator,
100+
spotId:spotId}});
101+
102+
navigator.title = spotName;
103+
}
167104
}
168105
}
169106

MobileClient/QtProject/src/qml.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<file>pages-picture/Page_PicturesList.qml</file>
3737
<file>pages-spot/Page_SpotsList.qml</file>
3838
<file>pages-upload/Page_AddToExistingSpot.qml</file>
39+
<file>views/SpotOverviewDelegate.qml</file>
3940
</qresource>
4041
<qresource prefix="/icon">
4142
<file>icon/find-location.png</file>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/********************************************************************
2+
* *
3+
* InstaSpots *
4+
* *
5+
* Author: Damiano Lombardi *
6+
* Created: 02.01.2015 *
7+
* *
8+
* Copiright (c) 2014 Damiano Lombardi *
9+
* *
10+
********************************************************************/
11+
12+
// Qt imports ------------------------------
13+
import QtQuick 2.0
14+
import QtQuick.Controls 1.2
15+
16+
// Project imports -------------------------
17+
import "qrc:/widgets"
18+
19+
Item {
20+
id: root
21+
width: parent.width
22+
height: rectangle_Top.height
23+
+ image_Picture1.height
24+
25+
signal spotClicked
26+
27+
Rectangle {
28+
id: rectangle_Top
29+
anchors.top: parent.top
30+
width: parent.width
31+
height: 40
32+
color: "#aaaaaa"
33+
Text{
34+
id: text_SpotName
35+
anchors.leftMargin: 2
36+
width: parent.width / 2
37+
height: parent.height / 2
38+
text: role_SpotName
39+
}
40+
Text {
41+
anchors.top: parent.top
42+
anchors.left: text_SpotName.right
43+
anchors.rightMargin: 2
44+
width: text_SpotName.width
45+
height: text_SpotName.height
46+
horizontalAlignment: Text.AlignRight
47+
text: role_SpotDistance
48+
}
49+
MouseArea {
50+
anchors.fill: parent
51+
onClicked: {
52+
spotClicked();
53+
}
54+
}
55+
}
56+
CachedPicture {
57+
id: image_Picture1
58+
anchors.top: rectangle_Top.bottom
59+
width: parent.width/2
60+
height: parent.width/2
61+
sourceUrl: role_SpotPictureUrl1
62+
MouseArea {
63+
anchors.fill: parent
64+
onClicked: {
65+
spotClicked();
66+
}
67+
}
68+
}
69+
CachedPicture {
70+
id: image_Picture2
71+
anchors.top: rectangle_Top.bottom
72+
anchors.left: image_Picture1.right
73+
width: parent.width/2
74+
height: parent.width/2
75+
sourceUrl: role_SpotPictureUrl2
76+
MouseArea {
77+
anchors.fill: parent
78+
onClicked: {
79+
spotClicked();
80+
}
81+
}
82+
}
83+
}

0 commit comments

Comments
 (0)