~josephjamesmills/+junk/americanFootball_api_stuff

« back to all changes in this revision

Viewing changes to Delegate/yahoo/HomeDel.qml

  • Committer: Joseph Mills
  • Date: 2013-12-15 15:25:28 UTC
  • Revision ID: josephjamesmills@gmail.com-20131215152528-vke40bcaabivhpm9
for dude to pull stuff out

Show diffs side-by-side

added added

removed removed

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