/*** ** Copyright (C) 2012 Christophe CHAPUIS ** ** This package is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This package is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this package; if not, write to the Free Software ** Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ** ***/ import QtQuick 1.0 Item { id: delegate width: delegate.ListView.view.width; height: 60 Text { text: listSourceModel[index].name color: delegate.ListView.isCurrentItem ? "white" : "black" font { family: "Helvetica"; pixelSize: 16; bold: true } anchors { left: parent.left; leftMargin: 15 verticalCenter: parent.verticalCenter } } BusyIndicator { scale: 0.6 on: delegate.ListView.isCurrentItem && window.loading anchors { right: parent.right; rightMargin: 10; verticalCenter: parent.verticalCenter } } Rectangle { width: delegate.width; height: 1; color: "#cccccc" anchors.bottom: delegate.bottom visible: delegate.ListView.isCurrentItem ? false : true } Rectangle { width: delegate.width; height: 1; color: "white" visible: delegate.ListView.isCurrentItem ? false : true } MouseArea { anchors.fill: delegate onPressAndHold: { // show the configuration for this journal if( listSourceModel[index].hasSettings ) { window.showConfigDialog(index) } } onClicked: { if( delegate.ListView.view.currentIndex !== index ) { // here we remove everything in viewsModel after index our depth while(window.windowViewsModel.count>1) window.windowViewsModel.remove(window.windowViewsModel.count-1) delegate.ListView.view.currentIndex = index listSourceModel[index].currentPath = [index] currentSourceIndex = index window.windowViewsModel.append({ component: listSourceModel[index].listViews[0].viewComponent, componentDepth: 1 }) //window.currentSourceIndex = index // doesn't work well with Qt 4.7.3 on Maemo... window.currentContentX = 1*window.width } } } }