-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNews.qml
126 lines (106 loc) · 3.02 KB
/
News.qml
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
114
115
116
117
118
119
120
121
122
123
124
125
126
import QtQuick 2.9
import QtGraphicalEffects 1.0
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
import QtQuick.LocalStorage 2.0 as Sql
import "news.js" as News
import "markdown.js" as MD
Item {
id:thisWindow
property string thenews: ""
property string date: ""
Timer {
id:newscheck
interval: 1000
running: true
repeat: true
onTriggered: {
if(heart != "OffLine") {
News.get_news();
}
}
}
Rectangle {
id:internalArea
anchors.fill: parent
color: backgroundColor
border.color: "black"
border.width: 1
//visible: false
Text {
id: title
text: qsTr("NEWS")
font.pixelSize: mainView.width * 0.1
anchors.left: parent.left
anchors.leftMargin:mainView.width * 0.03
anchors.top:parent.top
anchors.topMargin: mainView.width * 0.01
color:fontColorTitle
}
Text {
id: thedate
text:date
font.pixelSize: mainView.width * 0.04
anchors.right: parent.right
anchors.rightMargin:mainView.width * 0.03
anchors.bottom:title.bottom
anchors.bottomMargin: mainView.width * 0.01
color:fontColor
}
Rectangle {
width: parent.width
height: mainView.width * 0.01
color: seperatorColor1
anchors.top:title.bottom
}
Flickable {
anchors.top:title.bottom
anchors.topMargin: mainView.width * 0.01
anchors.bottom:okay.top
width: parent.width
contentHeight: news.height
clip:true
Text {
id: news
text: "<p>"+MD.md2html(thenews)+"</p>"
width: mainView.width * 0.93
padding: mainView.width * 0.02
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignLeft
anchors.horizontalCenter: parent.horizontalCenter
color:fontColor
}
}
Button {
id:okay
anchors.bottom: parent.bottom
anchors.bottomMargin: mainView.width * 0.01
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width * 0.60
height: mainView.width * 0.1
text:"Okay"
onClicked: News.dismiss_news(date)
background: Rectangle {
color:highLightColor1
radius: mainView.width * 0.01
}
contentItem: Text {
width:parent.width
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
//font:parent.font
text:parent.text
color:fontColorTitle
}
}
}
DropShadow {
anchors.fill: internalArea
horizontalOffset: 0
verticalOffset: 4
radius: 8.0
samples: 17
color: "#80000000"
source: internalArea
}
}