~josephjamesmills/ubuntutv/maps_fanart

« back to all changes in this revision

Viewing changes to shell/player/Controls.qml

  • Committer: Joseph Mills
  • Date: 2012-06-29 23:56:57 UTC
  • Revision ID: josephjamesmills@gmail.com-20120629235657-0zollco6r87bqidx
added saviq and jays code. added slots for "other" SimpleLaunchers added templeate for a "holding cell" for lens meaning that there will be a "Dash" that will be plkace holders to lens. Like a Internettv page that holds youtube hulu watchseries and other lens then a music one that holds a local musioc lens a groovesharkone ect.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
    property bool shown: false
12
12
    property variant video: null
 
13
    property variant button: button
13
14
 
14
15
    signal buttonClicked
 
16
    signal clicked
15
17
 
16
18
    function removeExt(uri) {
17
19
        return uri.toString().substring(0, uri.toString().lastIndexOf("."))
18
20
    }
19
21
 
 
22
    function close() {
 
23
        console.log("WARNING: Controls.close() unimplemented")
 
24
    }
 
25
    function previous() {
 
26
        sceneSelector.previous()
 
27
    }
 
28
    function next() {
 
29
        sceneSelector.next()
 
30
    }
 
31
 
20
32
    Item {
21
33
        id: mainContainer
22
34
        anchors.left: parent.left
41
53
            }
42
54
 
43
55
            Rectangle {
 
56
                MouseArea {
 
57
                    anchors.fill: parent
 
58
                }
44
59
                id: timelineBackgroundBorderRight
45
60
                anchors.right: parent.right
46
61
                anchors.bottom: parent.top
153
168
                }
154
169
            }
155
170
 
 
171
            MouseArea {
 
172
                anchors.fill: parent
 
173
                onClicked: if (!sceneSelector.activeFocus) controls.close()
 
174
            }
 
175
 
156
176
            onItemClicked: {
157
 
                hideOnFillerWidthAnimationEnd = true
 
177
                if (activeFocus) {
 
178
                    hideOnFillerWidthAnimationEnd = true
 
179
                    video.position = Math.ceil(video.duration * sceneSelector.currentIndex / 10)
 
180
                } else {
 
181
                    focus = true
 
182
                }
 
183
            }
 
184
            onSeekRequested: {
158
185
                video.position = Math.ceil(video.duration * sceneSelector.currentIndex / 10)
159
186
            }
160
187
 
161
188
            Keys.priority: Keys.AfterItem
162
189
 
163
190
            Keys.onPressed: {
164
 
                if (event.key == Qt.Key_Down && hideOnFillerWidthAnimationEnd) {
 
191
                if (event.key == Qt.Key_Down && hideOnFillerWidthAnimationEnd && !event.modifiers) {
165
192
                    // We will hide in a sec, ignore eat the event
166
193
                    event.accepted = true
167
194
                }
168
 
                if (event.key == Qt.Key_Left || event.key == Qt.Key_Right) {
169
 
                    event.accepted = true
 
195
                if ((event.key == Qt.Key_Left || event.key == Qt.Key_Right) && !event.modifiers) {
 
196
                    event.accepted = true
 
197
                }
 
198
                if ((event.key == Qt.Key_Escape || event.key == Qt.Key_Backspace) && !event.modifiers) {
 
199
                    event.accepted = true
 
200
                    button.focus = true
170
201
                }
171
202
            }
172
203
 
176
207
                }
177
208
            }
178
209
 
179
 
            Keys.onEscapePressed: {
180
 
                button.focus = true
181
 
            }
182
210
        }
183
211
 
184
212
        Connections {
212
240
            anchors.right: timeline.right; anchors.rightMargin: Units.tvPx(13)
213
241
            height: 28
214
242
 
 
243
            MouseArea {
 
244
                anchors.fill: parent
 
245
                onClicked: { video.position = video.duration * (mouseX / timeline.width); controls.clicked() }
 
246
            }
 
247
 
215
248
            Item {
216
249
                id: bufferFiller
217
250
                anchors.top: parent.top; anchors.bottom: parent.bottom