~saviq/unity8/cmake-pydev-fixes

« back to all changes in this revision

Viewing changes to qml/Dash/GenericScopeView.qml

  • Committer: CI bot
  • Author(s): Michał Sawicz, Albert Astals
  • Date: 2014-07-09 19:44:02 UTC
  • mfrom: (982.5.36 origin/scope-customizations)
  • Revision ID: ps-jenkins@lists.canonical.com-20140709194402-119vm2cw8aeymb3m
Add initial support for scope customizations. 
Approved by: Michael Zanetti, Michael Zanetti

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import Utils 0.1
20
20
import Unity 0.2
21
21
import Unity.Application 0.1
 
22
import Dash 0.1
22
23
import "../Components"
23
24
import "../Components/ListItems" as ListItems
24
25
 
33
34
    property bool enableHeightBehaviorOnNextCreation: false
34
35
    property var categoryView: categoryView
35
36
 
 
37
    property var scopeStyle: ScopeStyle {
 
38
        style: scope ? scope.customizations : {}
 
39
    }
 
40
 
36
41
    signal backClicked()
37
42
 
38
43
    onScopeChanged: {
97
102
        onHideDash: previewListView.open = false;
98
103
    }
99
104
 
 
105
    Rectangle {
 
106
        anchors.fill: parent
 
107
        color: scopeView.scopeStyle ? scopeView.scopeStyle.background : "transparent"
 
108
        visible: color != "transparent"
 
109
    }
 
110
 
100
111
    ScopeListView {
101
112
        id: categoryView
102
113
        objectName: "categoryListView"
164
175
                        item.model = Qt.binding(function() { return results })
165
176
                    }
166
177
                    item.objectName = Qt.binding(function() { return categoryId })
 
178
                    item.scopeStyle = scopeView.scopeStyle;
167
179
                    if (item.expandable) {
168
180
                        var shouldFilter = categoryId != categoryView.expandedCategoryId;
169
181
                        item.setFilter(shouldFilter, false /*animate*/);
303
315
            property var delegate: categoryView.item(delegateIndex)
304
316
            width: categoryView.width
305
317
            text: section
 
318
            textColor: scopeStyle ? scopeStyle.foreground : "grey"
306
319
            image: {
307
320
                if (delegate && delegate.expandable)
308
321
                    return delegate.filtered ? "graphics/header_handlearrow.png" : "graphics/header_handlearrow2.png"
324
337
            showBackButton: scopeView.hasBackAction
325
338
            searchEntryEnabled: true
326
339
            searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false
 
340
            scopeStyle: scopeView.scopeStyle
327
341
 
328
342
            bottomItem: DashDepartments {
329
343
                scope: scopeView.scope
331
345
                anchors.right: parent.right
332
346
                windowHeight: scopeView.height
333
347
                windowWidth: scopeView.width
 
348
                scopeStyle: scopeView.scopeStyle
334
349
            }
335
350
 
336
351
            onBackClicked: scopeView.backClicked()
342
357
        objectName: "previewListView"
343
358
        visible: x != width
344
359
        scope: scopeView.scope
 
360
        scopeStyle: scopeView.scopeStyle
345
361
        width: parent.width
346
362
        height: parent.height
347
363
        anchors.left: categoryView.right