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
25 objectName: "filtersPopover"
35 // Popover doesn't like being 75% or bigger than the screen (counting the "empty" part on top)
36 var posToRootParent = flickable.mapToItem(null, 0, 0).y;
37 var threeQuartersParent = root.parent.height * 3 / 4 - posToRootParent - 1;
38 var parentAndKeyboard = root.parent.height - posToRootParent - (Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height + units.gu(3) : 0)
39 return Math.min(parentAndKeyboard, Math.min(threeQuartersParent, column.height));
42 contentHeight: column.height
51 height: resetLabel.height + units.gu(3)
56 right: resetLabel.left
58 verticalCenter: parent.verticalCenter
60 text: i18n.tr("Refine your results")
66 rightMargin: units.gu(2)
67 verticalCenter: parent.verticalCenter
69 text: i18n.tr("Reset")
74 rightMargin: units.gu(-2)
75 leftMargin: units.gu(-2)
76 topMargin: units.gu(-1)
77 bottomMargin: units.gu(-1)
80 scopeView.scope.resetFilters();
88 model: scopeView.scope.filters
90 delegate: Filters.FilterWidgetFactory {
97 ListItems.ThinDivider {
98 anchors.bottom: parent.bottom
99 visible: index != repeater.count - 1