Use accent color for search highlight
authorLuciano Montanaro <mikelima@cirulla.net>
Tue, 9 Aug 2011 12:49:34 +0000 (14:49 +0200)
committerLuciano Montanaro <mikelima@cirulla.net>
Tue, 27 Dec 2011 22:16:50 +0000 (23:16 +0100)
application/resources/harmattan/qml/StationListPage.js
application/resources/harmattan/qml/StationListPage.qml

index 096eefc..747be56 100644 (file)
@@ -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, '<span style="text-decoration:underline">' +
+        return s.replace(r, '<span style="text-decoration:underline;color:' + color + ';">' +
                          match + '</span>')
     } else {
         return s
index 8d27815..1687c00 100644 (file)
@@ -100,7 +100,7 @@ Page {
 
                         Label {
                             id: mainText
-                            text: Private.highlightSearch(model.display)
+                            text: Private.highlightSearch(model.display, UiConstants.AccentColor)
                             font.bold: true
                         }
                     }