2 * Copyright (C) 2013-2015 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.Popups 1.3
20 import Ubuntu.Components.ListItems 1.3 as ListItems
21 import "Filters" as Filters
22 import "../Components"
26 objectName: "filtersPopover"
36 // Popover doesn't like being 75% or bigger than the screen (counting the "empty" part on top)
37 var posToRootParent = flickable.mapToItem(null, 0, 0).y;
38 var threeQuartersParent = root.parent.height * 3 / 4 - posToRootParent - 1;
39 var parentAndKeyboard = root.parent.height - posToRootParent - (Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height + units.gu(3) : 0)
40 return Math.min(parentAndKeyboard, Math.min(threeQuartersParent, column.height));
43 contentHeight: column.height
52 height: resetLabel.height + units.gu(3)
57 right: resetLabel.left
59 verticalCenter: parent.verticalCenter
61 text: i18n.tr("Refine your results")
67 rightMargin: units.gu(2)
68 verticalCenter: parent.verticalCenter
70 text: i18n.tr("Reset")
75 rightMargin: units.gu(-2)
76 leftMargin: units.gu(-2)
77 topMargin: units.gu(-1)
78 bottomMargin: units.gu(-1)
81 scopeView.scope.resetFilters();
89 model: scopeView.scope.filters
91 delegate: Filters.FilterWidgetFactory {
98 ListItems.ThinDivider {
99 anchors.bottom: parent.bottom
100 visible: index != repeater.count - 1