2 ** Copyright (C) 2012 Christophe CHAPUIS <chris.chapuis _at_ gmail _dot_ com>
4 ** This package is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
9 ** This package is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
14 ** You should have received a copy of the GNU General Public License
15 ** along with this package; if not, write to the Free Software
16 ** Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 width: delegate.ListView.view.width; height: 60
28 color: delegate.ListView.isCurrentItem ? "white" : "black"
29 font { family: "Helvetica"; pixelSize: 16; bold: true }
31 left: parent.left; leftMargin: 15
32 verticalCenter: parent.verticalCenter
38 on: delegate.ListView.isCurrentItem && window.loading
39 anchors { right: parent.right; rightMargin: 10; verticalCenter: parent.verticalCenter }
43 width: delegate.width; height: 1; color: "#cccccc"
44 anchors.bottom: delegate.bottom
45 visible: delegate.ListView.isCurrentItem ? false : true
48 width: delegate.width; height: 1; color: "white"
49 visible: delegate.ListView.isCurrentItem ? false : true
53 anchors.fill: delegate
55 var currentSourceDepth = delegate.ListView.view.model.sourceDepth
57 if (listSourceModel[window.currentSourceIndex].listViews.length >= currentSourceDepth+1)
59 // here we remove everything in viewsModel after index "nextSourceDepth"
60 while(window.windowViewsModel.count>currentSourceDepth+1)
61 window.windowViewsModel.remove(window.windowViewsModel.count-1)
63 delegate.ListView.view.currentIndex = index
64 var path = listSourceModel[window.currentSourceIndex].currentPath
65 path[currentSourceDepth] = index
66 listSourceModel[window.currentSourceIndex].currentPath = path.slice(0,currentSourceDepth+1)
68 window.windowViewsModel.append({ component: listSourceModel[window.currentSourceIndex].listViews[currentSourceDepth].viewComponent,
69 componentDepth: currentSourceDepth+1 })