KarmaItemDelegate.qml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // ---------------------------------------------------------------------------
  2. //Copyright (C) 2008-2011 Nokia Corporation and/or its subsidiary(-ies).
  3. //All rights reserved.
  4. //Contact: Nokia Corporation (qt-info@nokia.com)
  5. //You may use the files in this folder under the terms of the BSD
  6. //license as follows:
  7. //Redistribution and use in source and binary forms, with or without
  8. //modification, are permitted provided that the following conditions are
  9. //met:
  10. // * Redistributions of source code must retain the above copyright
  11. // notice, this list of conditions and the following disclaimer.
  12. // * Redistributions in binary form must reproduce the above copyright
  13. // notice, this list of conditions and the following disclaimer in
  14. // the documentation and/or other materials provided with the
  15. // distribution.
  16. // * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
  17. // the names of its contributors may be used to endorse or promote
  18. // products derived from this software without specific prior written
  19. // permission.
  20. //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. //"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. //LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. //A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. //OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. //SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. //LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. //DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. //THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. // ---------------------------------------------------------------------------
  31. import QtQuick 1.1
  32. import com.nokia.meego 1.0
  33. import "../js/UIConstants.js" as Ui
  34. Item {
  35. id: root
  36. property alias title: titleText.text
  37. property alias points: karmaPoints.text
  38. property int marging: 20
  39. signal clicked
  40. height: 80
  41. //width: 500
  42. anchors.left: parent.left
  43. anchors.right: parent.right
  44. Grid {
  45. id: grid
  46. columns: 2
  47. spacing: 10
  48. anchors.left: parent.left
  49. anchors.right: parent.right
  50. Label {
  51. id: titleText
  52. font.pixelSize: Ui.FONT_LARGE
  53. styleColor: "#000000"
  54. width: parent.width-karmaPoints.width
  55. }
  56. Label {
  57. id: karmaPoints;
  58. font.pixelSize: Ui.FONT_LARGE
  59. width: 50
  60. }
  61. }
  62. Rectangle{
  63. anchors.top: parent.bottom
  64. color: "#8f00ff"
  65. height: 2
  66. width: parent.width
  67. }
  68. MouseArea {
  69. id: mouseArea
  70. anchors.fill: grid
  71. onClicked:{
  72. root.clicked();
  73. }
  74. }
  75. }