From: Luciano Montanaro Date: Tue, 9 Aug 2011 12:49:34 +0000 (+0200) Subject: Use accent color for search highlight X-Git-Tag: tags/0.4.81~70 X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=35cd766bcf9dba95f2d92e7f8f96943092e584dc;p=quandoparte Use accent color for search highlight --- diff --git a/application/resources/harmattan/qml/StationListPage.js b/application/resources/harmattan/qml/StationListPage.js index 096eefc..747be56 100644 --- a/application/resources/harmattan/qml/StationListPage.js +++ b/application/resources/harmattan/qml/StationListPage.js @@ -14,14 +14,15 @@ function loadStation(name) console.log('Cannot load component: ' + component.errorString()); } -function highlightSearch(s) +function highlightSearch(s, color) { // TODO compile RegExp on change, or find a way to cleanly use // stationListProxyModel.filterRegExp + console.log("string:" + s + " color: " + color) if (searchField.text.length) { var r = new RegExp(searchField.text, 'i') var match = r.exec(s) - return s.replace(r, '' + + return s.replace(r, '' + match + '') } else { return s diff --git a/application/resources/harmattan/qml/StationListPage.qml b/application/resources/harmattan/qml/StationListPage.qml index 8d27815..1687c00 100644 --- a/application/resources/harmattan/qml/StationListPage.qml +++ b/application/resources/harmattan/qml/StationListPage.qml @@ -100,7 +100,7 @@ Page { Label { id: mainText - text: Private.highlightSearch(model.display) + text: Private.highlightSearch(model.display, UiConstants.AccentColor) font.bold: true } }