1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
import QtQuick 2.0
import QtQuick.Window 2.0
import QtWebKit 3.0
import "../Javascript/Utils.js" as Utils
Rectangle {
id: helloRoot
width: parent.width
height: parent.height
color: "green"
Rectangle{
id: background
width: parent.width
height: parent.height
color: "black"
radius: 20
border{
width: 2
color: "yellow"
}
state: "default"
Behavior on height{NumberAnimation{duration: 900;}}
MouseArea{
anchors.fill: background
onClicked: {
if(background.state === "default"){
background.state = "showFull"
}else{
background.state = "default"
Utils.destroyWebView()
}
}
}
Text {
id: titleTxt
text: title
color: "white"
y: background.state === "default" ? background.height / 2 - height/ 2 : 0
anchors{
horizontalCenter: background.horizontalCenter
}
}
Rectangle{
id: extraInfo
width: background.width
height: background.height / 1.2
color: "#88C7C7C7"
//this is the bottom color stuff
opacity: background.state === "default" ? 0 : 1
anchors.centerIn: parent
Column{
spacing: 30
width:parent.width / 1.3
anchors.centerIn: parent
Text {
text: summary
wrapMode: Text.WordWrap
width: parent.width / 1.3
color: "white"
}
Text {
text: "by "+ author
color: "white"
}
Text {
text:{
var t = created
var s = Qt.formatDateTime(t, "dddd MMMM d hh:mm ap")
return "created on \t" + s
}
color: "white"
}
Text {
id:urlTxt
text: "Read Full Artical"// url
color: "white"
MouseArea{
anchors.fill: urlTxt;
hoverEnabled: true
onEntered: urlTxt.color = "blue"
onExited: urlTxt.color = "white"
onClicked: {
console.log(Utils.c.status )
// if(Utils.c.status)
Utils.createWebView();
}
}
}
}
}
states: [
State {
name: "showFull"
PropertyChanges {
target: helloRoot
height: Screen.height
width: Screen.width
}
PropertyChanges { target: helloRoot.ListView.view; explicit: true; contentY: helloRoot.y }
PropertyChanges { target: helloRoot.ListView.view; interactive: false }
}
]
}
}
|