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
21 import "content/modelimpl"
22 import "content/modelitf"
26 //anchors.fill: parent // use this little trick to always adapt itself to the screen
27 width: 800; height: 480
29 property int currentSourceIndex: 0
31 property list<SourceModel> listSourceModel: [
33 GoogleReaderSourceModel{},
34 FavoriteFeedsSourceModel{},
38 property variant currentSource: listSourceModel[currentSourceIndex]
39 property bool loading: currentSource.loading
40 property alias windowViewsModel: viewsModel
41 property alias windowViewsList: viewsList
42 property alias currentContentX: viewsList.contentX
47 ListElement { component: "content/view/Sources.qml"; componentDepth: 0 }
55 orientation: ListView.Horizontal
56 snapMode: ListView.SnapOneItem
57 flickDeceleration: 500
58 cacheBuffer: 1600 // so that the next delegate gets actually loaded...
59 preferredHighlightBegin: window.x
60 preferredHighlightEnd: window.width
61 highlightRangeMode: ListView.StrictlyEnforceRange
62 boundsBehavior: Flickable.StopAtBounds
64 Behavior on contentX {
65 NumberAnimation { duration: 500; easing.type: Easing.InOutCubic }
74 viewsList.contentX = componentDepth*window.width
75 //viewsList.currentIndex = componentDepth // doesn't work well with Qt 4.7.3 on Maemo...
80 function showConfigDialog(index) {
81 configDialog.configModel = listSourceModel[index]
82 configDialog.state = "showSourceConfig"
93 id: quitButtonDelegate
95 width: parent.width; height: 60
98 font { family: "Helvetica"; pixelSize: 16; bold: true }
100 left: parent.left; leftMargin: 15
101 verticalCenter: parent.verticalCenter