-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMain.qml
133 lines (111 loc) · 3.08 KB
/
Main.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
127
128
129
130
131
132
133
import QtQuick 1.1
import OmniMedia 1.0
Rectangle {
id: window
width: 1024; height: 768; color: "black"
property Media currentMedia
function ensureHudVisible() {
panel.state = "HUDON"
// timer.restart()
}
Timer {
id: timer
interval: 3000; running: false; repeat: true
onTriggered: panel.state = "HUDOFF"
}
MouseArea {
hoverEnabled: true
anchors.fill: window
onHoveredChanged: ensureHudVisible()
}
Player {
source: window.currentMedia
id: videoPlayer
// VideoControl {
// x: (parent.width / 2) - (width / 2)
// y: (parent.height - 20) - height
// visible: false
//}
}
Rectangle {
id: panel
focus: true
width: 400; height: window.height; y: searchInput.height + searchInput.y
color: "black"; opacity: .8
Component {
id: highlight
Rectangle {
color: "white"; opacity: .2
y: list.currentItem.y
Behavior on y {
SpringAnimation {
spring: 3
damping: 0.2
}
}
}
}
ListView {
id: list
focus: true
anchors.fill: parent
model: youtubeModel
delegate: Delegate {}
highlight: highlight
}
Rectangle {
width: parent.width; height: 20
gradient: Gradient {
GradientStop { position: 0.0; color: "black" }
GradientStop { position: 1.0; color: "transparent" }
}
}
Rectangle {
width: parent.width; height: 20
anchors.bottom: list.bottom
gradient: Gradient {
GradientStop { position: 0.0; color: "transparent" }
GradientStop { position: 1.0; color: "black" }
}
}
ScrollBar { scrollArea: list; height: list.height; width: 8; anchors.right: list.right }
states : [
State {
name: "HUDON"
PropertyChanges {
target: panel
x: 0
}
},
State {
name: "HUDOFF"
PropertyChanges {
target: panel
x: -panel.width
}
}
]
transitions: [
Transition {
from: "HUDON"
to: "HUDOFF"
PropertyAnimation {
duration: 1000; properties: "x"
easing.type: Easing.OutCubic
}
},
Transition {
from: "HUDOFF"
to: "HUDON"
PropertyAnimation {
duration: 1000; properties: "x"
easing.type: Easing.OutCubic
}
}
]
}
SearchInput {
id: searchInput
width: panel.width
}
}