~josephjamesmills/ubuntutv/maps_fanart

« back to all changes in this revision

Viewing changes to shell/dash/Dash.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:
37
37
       The final goal is to transition to using exclusively the QML 'active' property
38
38
       and drop the C++ 'declarativeView.dashActive'.
39
39
    */
 
40
 
40
41
    property variant active
41
42
    property bool epgActive: false
 
43
   // property bool itvActive: false
42
44
    /* The following way of mirroring the values of 'declarativeView.dashActive'
43
45
       and 'active' works now and QML does not see it as a binding loop but we
44
46
       cannot count on it long term.
164
166
        declarativeView.activeLens = ""
165
167
    }
166
168
 
 
169
   /* function deactivateActiveLens() {
 
170
        itvActive = false
 
171
        if (previewer.active) hidePreview()
 
172
        if (declarativeView.activeLens != "") {
 
173
            var lens = lenses.get(declarativeView.activeLens)
 
174
            lens.active = false
 
175
        }
 
176
        declarativeView.activeLens = ""
 
177
    }
 
178
*/
167
179
    function activateLens(lensId) {
168
180
        if (lensId == declarativeView.activeLens) {
169
181
            dash.active = true
206
218
        dash.active = true
207
219
    }
208
220
 
 
221
    /*function activateITV() {
 
222
        deactivateActiveLens()
 
223
        itvActive = true
 
224
        pageLoader.setSource("ITV.qml")
 
225
        activatePage(pageLoader.item)
 
226
        declarativeView.activeLens = ""
 
227
        dash.active = true
 
228
    }
 
229
*/
209
230
    function activateLensWithOptionFilter(lensId, filterId, optionId) {
210
231
        var lens = lenses.get(lensId)
211
232
        var filter = lens.filters.getFilter(filterId)
260
281
    }
261
282
 
262
283
    function hidePreview() {
 
284
        if (!previewer.active) return
263
285
        previewer.active = false
264
286
        pageLoader.focus = true
265
287
        previewer.uri = ""
477
499
        color: "black"
478
500
        opacity: 0.5
479
501
    }
 
502
    MouseArea {
 
503
        anchors.fill: content
 
504
        enabled: !content.activeFocus
 
505
        onClicked: content.focus = true
 
506
    }
480
507
 
481
508
    Sidebar {
482
509
        id: sidebar
488
515
 
489
516
        Behavior on x { NumberAnimation { duration: 125 } }
490
517
 
491
 
        Keys.onEscapePressed: {
492
 
            sidebar.focus = false
493
 
            content.forceActiveFocus()
 
518
        Keys.onPressed: {
 
519
            if (event.key == Qt.Key_Escape || event.key == Qt.Key_Backspace) {
 
520
                sidebar.focus = false
 
521
                content.forceActiveFocus()
 
522
            }
494
523
        }
495
524
 
496
525
        // Prevent key navigation from the sidebar