5 Component { id: rcDelegate
8 property real detailsOpacity : 0
9 property real minSize : 18
14 x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
16 // border.color: "#606060"
18 //opacity: delegateItem.detailsOpacity
34 delegateItem.state = 'Details';
36 loader.sourceComponent = webViewPage;
42 //anchors.verticalCenter: parent.verticalCenter
44 width: parent.width-10
45 height: parent.height-4
48 ///anchors.verticalCenter: parent.verticalCenter
52 //width: 2*parent.width/3
56 width: delegateItem.width;
59 font.pixelSize: delegateItem.minSize+2
61 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
62 // opacity: delegateItem.detailsOpacity
68 width: delegateItem.width;
70 font.pixelSize: delegateItem.minSize
71 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
72 // opacity: delegateItem.detailsOpacity
79 ///anchors.bottom: parent.bottom
81 width: parent.width/2-2
86 font.pixelSize: delegateItem.minSize
87 anchors.left: parent.left
91 width: parent.width/2-2
92 Text { text: timestamp
94 font.pixelSize: delegateItem.minSize
95 anchors.right: parent.right
96 //opacity: delegateItem.detailsOpacity
105 x: 0; width: parent.width //- 20
106 anchors { top: topLayout.top; topMargin: 0; bottom: parent.bottom; bottomMargin: 0 }
107 // anchors.margins: 10
108 opacity: delegateItem.detailsOpacity
109 //opacity: webView.progress == 1.0 ? 0.0 : 1.0
115 height: parent.height; width: parent.width
119 //Content.ParseModel { id: parseModel }
122 //width: webView.width
123 //height: webView.height
124 //border.color: "gray"
127 Content.ParseModel { id: parseModel }
131 height: details.height-60
132 newWindowComponent: webViewPage
133 newWindowParent: pages
134 //url: "http://en.wikipedia.org/w/index.php?title=" + innerTxt.text
135 //url: "http://fr.wikipedia.org/w/api.php?action=parse&page="+innerTxt.text
138 function getArticle(title) {
141 var article = parseModel.get(0).article;
142 console.debug("=>>>>innerText"+title);
145 html: getArticle(innerTxt.text)
147 ParseModel { id: parseModel }
155 //Text { text: article }
159 height: details.height
164 height: parent.height
165 contentWidth: Math.max(flickable.width,webView.width)
166 contentHeight: Math.max(flickable.height,webView.height)
172 transformOrigin: Item.TopLeft
174 // smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions
179 height: parent.height
180 newWindowComponent: webViewPage
181 newWindowParent: pages
183 html: "<div style=\"background-color:white\">"+article+"</div>" }
192 height: parent.height
193 contentWidth: Math.max(flickable.width,webView.width)
194 contentHeight: Math.max(flickable.height,webView.height)
202 // Loader { sourceComponent: webViewPage }
206 // A button to close the detailed view, i.e. set the state back to default ('').
209 anchors { right: background.right; bottom: background.bottom ;rightMargin: 10 }
210 opacity: delegateItem.detailsOpacity
214 delegateItem.state = '';
219 // Animate adding and removing of items:
221 ListView.onAdd: SequentialAnimation {
222 PropertyAction { target: delegateItem; property: "height"; value: 0 }
223 NumberAnimation { target: delegateItem; property: "height"; to: 120; duration: 250; easing.type: Easing.InOutQuad }
226 ListView.onRemove: SequentialAnimation {
227 PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: true }
228 NumberAnimation { target: delegateItem; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
230 // Make sure delayRemove is set back to false so that the item can be destroyed
231 PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: false }
237 PropertyChanges { target: background; color: "#c0c0c0" }
238 //PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
239 PropertyChanges { target: delegateItem; detailsOpacity: 1; x: 0 } // Make details visible
240 PropertyChanges { target: delegateItem; height: lstRC.height } // Fill the entire list area with the detailed view
242 // Move the list so that this item is at the top.
243 PropertyChanges { target: delegateItem.ListView.view; explicit: true; contentY: delegateItem.y }
245 // Disallow flicking while we're in detailed view
246 PropertyChanges { target: delegateItem.ListView.view; interactive: false }
249 transitions: Transition {
250 // Make the state changes smooth
252 ColorAnimation { property: "color"; duration: 500 }
253 NumberAnimation { duration: 300; properties: "detailsOpacity,x,contentY,height,width" }