Advertisement
Guest User

Untitled

a guest
Jun 10th, 2014
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. import QtQuick 2.0
  2. import Sailfish.Silica 1.0
  3. import "../common"
  4. import "../js/DurationFormatter.js" as DurationFormatter
  5.  
  6. Page {
  7. id: searchPage
  8.  
  9. SilicaListView {
  10. id: list
  11.  
  12. property alias searchField: headerItem
  13.  
  14. anchors.fill: parent
  15. currentIndex: -1
  16.  
  17. header: SearchField {
  18. //id: searchField
  19. width: parent.width
  20.  
  21. placeholderText: qsTr("Search")
  22.  
  23. onTextChanged: {
  24. if (text)
  25. genreModel.qxFetchByQuery_("where name LIKE '%" + text +"%'")
  26. else
  27. genreModel.qxFetchAll_();
  28. }
  29. }
  30.  
  31. model: genreModel
  32.  
  33. delegate: ListItem {
  34. id: listItem
  35.  
  36. Label {
  37. anchors {
  38. left: parent.left
  39. leftMargin: Theme.paddingLarge
  40.  
  41. right: parent.right
  42. rightMargin: Theme.paddingLarge
  43.  
  44. verticalCenter: parent.verticalCenter
  45. }
  46.  
  47. text: searchField.text ? Theme.highlightText(model.Name, searchField.text, Theme.highlightColor) : model.Name //model.Name
  48. font.pixelSize: Theme.fontSizeMedium
  49.  
  50. color: listItem.highlighted ? Theme.highlightColor : Theme.primaryColor
  51. }
  52. }
  53.  
  54. // header: PageHeader {
  55. // id: header
  56. // title: qsTr("Genres")
  57. // }
  58.  
  59. ViewPlaceholder {
  60. text: qsTr("No genres available.")
  61. enabled: list.count == 0
  62. }
  63.  
  64. VerticalScrollDecorator {}
  65. }
  66.  
  67. // Column {
  68. // id: headerBox
  69. // parent: list.headerItem ? list.headerItem : searchPage
  70.  
  71. // anchors {
  72. // left: parent.left
  73. // right: parent.right
  74. // }
  75.  
  76. // PageHeader {
  77. // title: qsTr("Search")
  78. // }
  79.  
  80.  
  81. // }
  82.  
  83. RemorsePopup {
  84. id: remorse
  85. }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement