AddFeedSheetDelegate.qml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 2012 Róbert Márki
  4. **
  5. ** This file is part of Web Feeds.
  6. **
  7. ** Web Feeds is free software: you can redistribute it and/or modify
  8. ** it under the terms of the GNU General Public License as published by
  9. ** the Free Software Foundation, either version 3 of the License, or
  10. ** (at your option) any later version.
  11. **
  12. ** Web Feeds is distributed in the hope that it will be useful,
  13. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ** GNU General Public License for more details.
  16. **
  17. ** You should have received a copy of the GNU General Public License
  18. ** along with Web Feeds. If not, see <http://www.gnu.org/licenses/>.
  19. ****************************************************************************/
  20. import QtQuick 1.1
  21. import com.nokia.meego 1.0
  22. import com.nokia.extras 1.1
  23. import "../../../../shared/qml" as Shared
  24. import "../../../../shared/qml/UIConstants.js" as UIConstants
  25. import "../misc" as Misc
  26. import NewsBlur 1.0
  27. Item {
  28. id: root
  29. signal released(int row)
  30. signal holded(int row)
  31. property int titleSize: UIConstants.LIST_TILE_SIZE
  32. property int titleWeight: Font.Bold
  33. property color titleColor: UIConstants.LIST_TITLE_COLOR
  34. property int subtitleSize: UIConstants.LIST_SUBTILE_SIZE
  35. property int subtitleWeight: Font.Light
  36. property color subtitleColor: UIConstants.LIST_SUBTITLE_COLOR
  37. property variant service
  38. height: UIConstants.DEFAULT_DELEGATE_HEIGHT
  39. width: parent.width
  40. BorderImage {
  41. id: background
  42. anchors.fill: parent
  43. // Fill page porders
  44. anchors.leftMargin: -UIConstants.DEFAULT_MARGIN
  45. anchors.rightMargin: -UIConstants.DEFAULT_MARGIN
  46. visible: mouseArea.pressed
  47. source: "image://theme/meegotouch-panel-background-pressed"
  48. }
  49. Shared.Separator {
  50. id: separator
  51. anchors.top: parent.top
  52. anchors.left: parent.left
  53. anchors.leftMargin: UIConstants.DEFAULT_MARGIN
  54. anchors.right: parent.right
  55. anchors.rightMargin: UIConstants.DEFAULT_MARGIN
  56. visible: index
  57. }
  58. Item {
  59. id: conents
  60. anchors.top: parent.top
  61. anchors.bottom: parent.bottom
  62. anchors.left: parent.left
  63. anchors.leftMargin: UIConstants.DEFAULT_MARGIN
  64. anchors.right: parent.right
  65. anchors.rightMargin: UIConstants.DEFAULT_MARGIN
  66. Label {
  67. id: title
  68. anchors.top: parent.top
  69. anchors.topMargin: UIConstants.DEFAULT_HALF_MARGIN
  70. anchors.left: parent.left
  71. anchors.right: parent.right
  72. text: model.title
  73. font.family: UIConstants.FONT_FAMILY
  74. font.weight: root.titleWeight
  75. font.pixelSize: root.titleSize
  76. textFormat: Text.PlainText
  77. color: root.titleColor
  78. elide: Text.ElideRight
  79. maximumLineCount: 1
  80. }
  81. Label {
  82. id: url
  83. anchors.bottom: parent.bottom
  84. anchors.bottomMargin: UIConstants.DEFAULT_HALF_MARGIN
  85. anchors.left: parent.left
  86. anchors.right: parent.right
  87. text: model.subtitle
  88. font.pixelSize: UIConstants.FONT_LSMALL
  89. font.family: UIConstants.FONT_FAMILY_LIGHT
  90. color: "dimgray"
  91. elide: Text.ElideRight
  92. maximumLineCount: 1
  93. }
  94. }
  95. MouseArea {
  96. id: mouseArea;
  97. anchors.fill: parent
  98. onReleased: {
  99. if(!mouse.wasHeld)
  100. root.released(index);
  101. }
  102. onPressAndHold: {
  103. root.holded(index);
  104. }
  105. }
  106. }