2
* uNav http://launchpad.net/unav
3
* Copyright (C) 2016 Nekhelesh Ramananthan https://launchpad.net/~nik90
5
* uNav is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
9
* uNav 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 program. If not, see <http://www.gnu.org/licenses/>.
19
import Ubuntu.Components 1.3
22
Component which extends the SDK Expandable list item and provides a easy
23
to use component where the title, subtitle and a listview can be displayed. It
24
matches the design specification provided for clock.
28
id: expandableListItem
31
property ListModel model
32
property Component delegate
33
property alias titleText: expandableHeader.title
34
property alias subText: expandableHeader.subtitle
35
property alias listViewHeight: expandableListLoader.height
37
height: headerListItem.height
38
expansion.height: headerListItem.height + expandableListLoader.height
39
onClicked: toggleExpansion()
41
function toggleExpansion() {
42
expansion.expanded = !expansion.expanded
47
height: expandableHeader.height + divider.height
52
subtitle.textSize: Label.Medium
59
SlotsLayout.position: SlotsLayout.Trailing
61
rotation: expandableListItem.expansion.expanded ? 180 : 0
63
Behavior on rotation {
64
UbuntuNumberAnimation {}
71
id: expandableListLoader
74
anchors.top: headerListItem.bottom
75
sourceComponent: expandableListItem.expansion.expanded ? expandableListComponent : undefined
79
id: expandableListComponent
83
model: expandableListItem.model
84
delegate: expandableListItem.delegate