2
Copyright 2010 Marco Martin <notmart@gmail.com>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library 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 GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
21
import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
22
import org.kde.plasma.core 0.1 as PlasmaCore
23
import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
29
property Component delegate
30
property QtObject model
31
property string searchQuery
40
contentWidth: container.width; contentHeight: container.height
47
width: mainFlickable.width
48
Component.onCompleted: {
49
mainFlickable.contentY = searchFieldContainer.height
53
id: searchFieldContainer
56
PlasmaCore.FrameSvgItem {
58
imagePath: "widgets/lineedit"
63
anchors.horizontalCenter: parent.horizontalCenter
64
anchors.verticalCenter: parent.verticalCenter
68
anchors.leftMargin: background.margins.left
69
anchors.rightMargin: background.margins.right
70
anchors.topMargin: background.margins.top
71
anchors.bottomMargin: background.margins.bottom
73
searchTimer.running = true
77
id: hideSearchFieldAnim
79
properties: "contentY"
88
if (searchField.text == "") {
89
clearButton.visible = false
91
clearButton.visible = true
93
searchQuery = searchField.text
94
hideSearchFieldAnim.to = searchFieldContainer.height;
95
hideSearchFieldAnim.running = true;
98
PlasmaWidgets.IconWidget {
100
anchors.verticalCenter: parent.verticalCenter
101
anchors.right: parent.right
102
anchors.rightMargin: -10
105
Component.onCompleted: {
106
setIcon("edit-clear-locationbar-rtl")
109
searchField.text = ""
116
objectName: "appsView"
117
width: mainFlickable.width
118
height: mainFlickable.height
120
model: main.model?Math.ceil(main.model.count/18.0):0
121
highlightRangeMode: ListView.StrictlyEnforceRange
122
orientation: ListView.Horizontal
123
snapMode: ListView.SnapOneItem
126
signal clicked(string url)
130
width: appsView.width
131
height: appsView.height
133
anchors.horizontalCenter: parent.horizontalCenter
134
rows: appsView.width > 600 ? 3 : 5
136
model: MobileComponents.PagedProxyModel {
137
sourceModel: main.model
141
delegate: main.delegate
149
anchors.left: parent.left
150
anchors.right: parent.right
151
anchors.top: mainFlickable.bottom
152
anchors.topMargin: 10
154
anchors.centerIn: parent
158
model: main.model?Math.ceil(main.model.count/18.0):0
161
y: appsView.currentIndex == index ? -2 : 0
162
width: appsView.currentIndex == index ? 10 : 6
163
height: appsView.currentIndex == index ? 10 : 6
166
color: appsView.currentIndex == index ? Qt.rgba(1,1,1,1) : Qt.rgba(1,1,1,0.6)
169
width: 20; height: 20
170
anchors.centerIn: parent
171
onClicked: appsView.currentIndex = index