2 * Copyright (C) 2016 Canonical, Ltd.
4 * This program 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; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 import Ubuntu.Components 1.3
19 import Ubuntu.Components.ListItems 1.3 as ListItems
21 /*! Expandable Filter Widget. */
26 showsTitleOnItsOwn: true
28 implicitHeight: expandingItem.height
30 ListItems.Expandable {
32 objectName: "expandingItem"
34 expandedHeight: collapsedHeight + column.height
35 anchors.left: parent.left
36 anchors.right: parent.right
47 anchors.top: parent.top
48 height: expandingItem.collapsedHeight
49 anchors.left: parent.left
50 anchors.right: parent.right
53 anchors.left: parent.left
54 anchors.leftMargin: units.gu(2)
55 anchors.right: dropDown.left
56 anchors.verticalCenter: parent.verticalCenter
57 text: widgetData.title || ""
63 fillMode: Image.PreserveAspectFit
64 anchors.right: parent.right
65 anchors.rightMargin: units.gu(2)
66 anchors.verticalCenter: parent.verticalCenter
67 source: expandingItem.expanded ? "image://theme/up" : "image://theme/down"
68 sourceSize.height: height
74 anchors.left: parent.left
75 anchors.right: parent.right
76 anchors.top: titleHolder.bottom
80 model: widgetData.filters
82 delegate: FilterWidgetFactory {
89 ListItems.ThinDivider {
90 anchors.bottom: parent.bottom
91 visible: index !== repeater.count - 1