on xenial help sign in
Move divider to filterspopover instead of individual filters
commit49bb8b9017c8b4debfd9c96521ccacfcb870c5ce authorAlbert Astals Cid <albert.astals@canonical.com> dateWed 25 Nov 2015, 09:57 (11 years ago) parent773d857
3 files changed+10−1
qml/Dash/Filters/FilterOptionSelector.qml+1 qml/Dash/FiltersPopover.qml+7 tests/mocks/Unity/fake_filters.cpp+2−1
qml/Dash/Filters/FilterOptionSelector.qml+1
@@ -30,6 +30,7 @@ FilterWidget {
3030
3131 expandedHeight: collapsedHeight + column.height
3232 width: parent.width
33+ showDivider: false
3334
3435 onClicked: {
3536 expanded = !expanded;
qml/Dash/FiltersPopover.qml+7
@@ -17,6 +17,7 @@
1717import QtQuick 2.4
1818import Ubuntu.Components 1.3
1919import Ubuntu.Components.Popups 1.3
20+import Ubuntu.Components.ListItems 1.3 as ListItems
2021import "Filters" as Filters
2122
2223Popover {
@@ -77,6 +78,7 @@ Popover {
7778 }
7879
7980 Repeater {
81+ id: repeater
8082 model: scopeView.scope.filters
8183
8284 delegate: Filters.FilterWidgetFactory {
@@ -85,6 +87,11 @@ Popover {
8587 widgetId: id
8688 widgetType: type
8789 widgetData: filter
90+
91+ ListItems.ThinDivider {
92+ anchors.bottom: parent.bottom
93+ visible: index != repeater.count - 1
94+ }
8895 }
8996 }
9097 }
tests/mocks/Unity/fake_filters.cpp+2−1
@@ -24,7 +24,6 @@ Filters::Filters(Scope* parent)
2424 : unity::shell::scopes::FiltersInterface(parent)
2525{
2626 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));
2827
2928 FakeRangeInputFilter *rif = new FakeRangeInputFilter("RIF1", "Tag3", this);
3029 rif->setTitle("How much do you want to walk?");
@@ -32,6 +31,8 @@ Filters::Filters(Scope* parent)
3231 rif->setStartPostfixLabel("m");
3332 rif->setEndPostfixLabel("m");
3433 addFilter(rif);
34+
35+ addFilter(new FakeOptionSelectorFilter("OSF2", "Tag2", "Which Countries have you been to?", true, QStringList() << "Germany" << "UK" << "New Zealand", this));
3536}
3637
3738void Filters::addFilter(unity::shell::scopes::FilterBaseInterface *f)