on xenial help sign in
Move divider to filterspopover instead of individual filters
49bb8b9Albert Astals Cid
qml/Dash/Filters/FilterOptionSelector.qml+1
@@ -30,6 +30,7 @@ FilterWidget {
30
30
31 expandedHeight: collapsedHeight + column.height
31 expandedHeight: collapsedHeight + column.height
32 width: parent.width
32 width: parent.width
33+ showDivider: false
33
34
34 onClicked: {
35 onClicked: {
35 expanded = !expanded;
36 expanded = !expanded;
qml/Dash/FiltersPopover.qml+7
@@ -17,6 +17,7 @@
17import QtQuick 2.4
17import QtQuick 2.4
18import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
19import Ubuntu.Components.Popups 1.3
19import Ubuntu.Components.Popups 1.3
20+import Ubuntu.Components.ListItems 1.3 as ListItems
20import "Filters" as Filters
21import "Filters" as Filters
21
22
22Popover {
23Popover {
@@ -77,6 +78,7 @@ Popover {
77 }
78 }
78
79
79 Repeater {
80 Repeater {
81+ id: repeater
80 model: scopeView.scope.filters
82 model: scopeView.scope.filters
81
83
82 delegate: Filters.FilterWidgetFactory {
84 delegate: Filters.FilterWidgetFactory {
@@ -85,6 +87,11 @@ Popover {
85 widgetId: id
87 widgetId: id
86 widgetType: type
88 widgetType: type
87 widgetData: filter
89 widgetData: filter
90+
91+ ListItems.ThinDivider {
92+ anchors.bottom: parent.bottom
93+ visible: index != repeater.count - 1
94+ }
88 }
95 }
89 }
96 }
90 }
97 }
tests/mocks/Unity/fake_filters.cpp+2−1
@@ -24,7 +24,6 @@ Filters::Filters(Scope* parent)
24 : unity::shell::scopes::FiltersInterface(parent)
24 : unity::shell::scopes::FiltersInterface(parent)
25{
25{
26 addFilter(new FakeOptionSelectorFilter("OSF1", "Tag1", "Which Cake you like More", false, QStringList() << "cheese" << "carrot" << "chocolate", this));
26 addFilter(new FakeOptionSelectorFilter("OSF1", "Tag1", "Which Cake you like More", false, QStringList() << "cheese" << "carrot" << "chocolate", this));
27− addFilter(new FakeOptionSelectorFilter("OSF2", "Tag2", "Which Countries have you been to?", true, QStringList() << "Germany" << "UK" << "New Zealand", this));
28
27
29 FakeRangeInputFilter *rif = new FakeRangeInputFilter("RIF1", "Tag3", this);
28 FakeRangeInputFilter *rif = new FakeRangeInputFilter("RIF1", "Tag3", this);
30 rif->setTitle("How much do you want to walk?");
29 rif->setTitle("How much do you want to walk?");
@@ -32,6 +31,8 @@ Filters::Filters(Scope* parent)
32 rif->setStartPostfixLabel("m");
31 rif->setStartPostfixLabel("m");
33 rif->setEndPostfixLabel("m");
32 rif->setEndPostfixLabel("m");
34 addFilter(rif);
33 addFilter(rif);
34+
35+ addFilter(new FakeOptionSelectorFilter("OSF2", "Tag2", "Which Countries have you been to?", true, QStringList() << "Germany" << "UK" << "New Zealand", this));
35}
36}
36
37
37void Filters::addFilter(unity::shell::scopes::FilterBaseInterface *f)
38void Filters::addFilter(unity::shell::scopes::FilterBaseInterface *f)