~ubuntu-branches/ubuntu/vivid/muon/vivid-proposed

« back to all changes in this revision

Viewing changes to discover/qml/Main.qml

  • Committer: Package Import Robot
  • Author(s): Scarlett Clark
  • Date: 2015-03-24 07:36:31 UTC
  • mto: This revision was merged to the branch mainline in revision 86.
  • Revision ID: package-import@ubuntu.com-20150324073631-7nmay5episnfkdlt
Tags: upstream-5.2.2
ImportĀ upstreamĀ versionĀ 5.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
        onListCategoryInternal: Navigation.openCategoryByName(name)
148
148
    }
149
149
 
150
 
    Item {
151
 
        id: breadcrumbsItemBar
152
 
        anchors {
153
 
            top: parent.top
154
 
            left: parent.left
155
 
            right: pageToolBar.left
156
 
            rightMargin: pageToolBar.visible ? 10 : 0
157
 
        }
158
 
        height: breadcrumbsItem.count==0 ? 0 : breadcrumbsItem.Layout.minimumHeight
159
 
 
160
 
        Breadcrumbs {
161
 
            id: breadcrumbsItem
162
 
            anchors.fill: parent
163
 
 
164
 
            pageStack: pageStack
165
 
            onPoppedPages: window.clearSearch()
166
 
            Component.onCompleted: breadcrumbsItem.pushItem("go-home", "")
167
 
        }
168
 
        Behavior on height { NumberAnimation { duration: 250 } }
169
 
    }
170
 
 
171
 
    ToolBar {
172
 
        id: pageToolBar
173
 
        anchors {
174
 
            top: parent.top
175
 
            right: parent.right
176
 
        }
177
 
        height: visible && toolbarLoader.item ? toolbarLoader.item.Layout.minimumHeight : 0
178
 
        width: toolbarLoader.item ? toolbarLoader.item.width+5 : 0
179
 
        visible: width>0
180
 
 
181
 
        Loader {
182
 
            id: toolbarLoader
183
 
            sourceComponent: pageStack.currentItem ? pageStack.currentItem.tools : null
184
 
        }
185
 
 
186
 
        Behavior on width { NumberAnimation { duration: 250 } }
187
 
    }
188
 
 
189
 
    StackView {
190
 
        id: pageStack
191
 
        anchors {
192
 
            bottom: progressBox.top
193
 
            top: parent.top
194
 
            left: parent.left
195
 
            right: parent.right
196
 
            topMargin: Math.max(breadcrumbsItemBar.height, pageToolBar.height)
197
 
        }
198
 
 
199
 
        onDepthChanged: {
200
 
            if(depth==1) {
201
 
                breadcrumbsItem.removeAllItems()
202
 
            }
203
 
        }
204
 
    }
205
 
 
206
 
    ProgressView {
207
 
        id: progressBox
208
 
        anchors {
209
 
            left: parent.left
210
 
            right: parent.right
211
 
            bottom: parent.bottom
 
150
    ColumnLayout {
 
151
        id: msgColumn
 
152
        width: parent.width
 
153
        visible: rep.count>0
 
154
 
 
155
        Repeater {
 
156
            id: rep
 
157
            model: MessageActionsModel {
 
158
                filterPriority: QAction.HighPriority
 
159
            }
 
160
            delegate: MessageAction {
 
161
                width: msgColumn.width
 
162
                Layout.fillWidth: true
 
163
                theAction: action
 
164
            }
 
165
        }
 
166
    }
 
167
 
 
168
    ColumnLayout {
 
169
        spacing: 0
 
170
        anchors {
 
171
            fill: parent
 
172
            topMargin: msgColumn.height
 
173
        }
 
174
 
 
175
        Item {
 
176
            Layout.fillWidth: true
 
177
            Layout.minimumHeight: (breadcrumbsItem.visible || pageToolBar.visible) ? Math.max(breadcrumbsItem.Layout.minimumHeight, pageToolBar.Layout.minimumHeight)+5 : 0
 
178
 
 
179
            Breadcrumbs {
 
180
                id: breadcrumbsItem
 
181
 
 
182
                anchors {
 
183
                    top: parent.top
 
184
                    left: parent.left
 
185
                    bottom: parent.bottom
 
186
                    right: pageToolBar.left
 
187
                    rightMargin: pageToolBar.visible ? 10 : 0
 
188
                }
 
189
 
 
190
                pageStack: pageStack
 
191
                onPoppedPages: window.clearSearch()
 
192
                Component.onCompleted: breadcrumbsItem.pushItem("go-home", "")
 
193
//                 Behavior on height { NumberAnimation { duration: 250 } }
 
194
            }
 
195
 
 
196
            ToolBar {
 
197
                id: pageToolBar
 
198
 
 
199
                anchors {
 
200
                    top: parent.top
 
201
                    right: parent.right
 
202
                    bottom: parent.bottom
 
203
                }
 
204
                Layout.minimumHeight: toolbarLoader.item ? toolbarLoader.item.Layout.minimumHeight : 0
 
205
                width: toolbarLoader.item ? toolbarLoader.item.width+5 : 0
 
206
                visible: width>0
 
207
 
 
208
                Loader {
 
209
                    id: toolbarLoader
 
210
                    sourceComponent: pageStack.currentItem ? pageStack.currentItem.tools : null
 
211
                }
 
212
 
 
213
                Behavior on width { NumberAnimation { duration: 250 } }
 
214
            }
 
215
        }
 
216
 
 
217
        StackView {
 
218
            id: pageStack
 
219
            Layout.fillWidth: true
 
220
            Layout.fillHeight: true
 
221
 
 
222
            onDepthChanged: {
 
223
                if(depth==1) {
 
224
                    breadcrumbsItem.removeAllItems()
 
225
                }
 
226
            }
 
227
        }
 
228
 
 
229
        ProgressView {
 
230
            id: progressBox
 
231
            Layout.fillWidth: true
212
232
        }
213
233
    }
214
234
}