Commit 08d19bc8 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Simplify search UX on non-application lists

Now that pressing enter is required, it makes less sense to jump to the
home page when the search is cleared.
Don't show the search field on updates, it's weird and not really useful.
Make sources filtering case insensitive.

BUG: 384463
parent 61f822a2
......@@ -64,15 +64,12 @@ Kirigami.GlobalDrawer {
componentTrue: SearchField {
id: searchField
enabled: window.leftPage && (window.leftPage.searchFor != null || window.leftPage.hasOwnProperty("search"))
visible: window.leftPage && (window.leftPage.searchFor != null || window.leftPage.hasOwnProperty("search"))
Keys.forwardTo: [window.pageStack]
page: window.leftPage
onCurrentSearchTextChanged: {
if (currentSearchText.length === 0)
Navigation.openHome()
var curr = window.leftPage;
if (!curr.hasOwnProperty("search")) {
Navigation.clearStack()
......
......@@ -35,7 +35,7 @@ DiscoverPage {
mainItem: ListView {
id: sourcesView
model: QSortFilterProxyModel{
filterRegExp: new RegExp(page.search)
filterRegExp: new RegExp(page.search, 'i')
sourceModel: KConcatenateRowsProxyModel {
id: everySourceModel
}
......
......@@ -14,7 +14,6 @@ DiscoverPage
id: page
title: i18n("Updates")
property string search: ""
property string footerLabel: ""
Kirigami.Action
......@@ -148,7 +147,7 @@ DiscoverPage
backgroundColor: Kirigami.Theme.viewBackgroundColor
x: Kirigami.Units.gridUnit
width: ListView.view.width - Kirigami.Units.gridUnit * 2
highlighted: ListView.isCurrentItem || (page.search.length>0 && display.indexOf(page.search)>=0)
highlighted: ListView.isCurrentItem
onEnabledChanged: if (!enabled) {
layout.extended = false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment