QuiaEntryDetailed.qml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. import Qt 4.7
  2. Rectangle {
  3. id: entryDetailed
  4. width: 516
  5. height: 346
  6. gradient: Gradient {
  7. GradientStop {
  8. position: 0
  9. color: "#090808"
  10. }
  11. GradientStop {
  12. position: 0.32
  13. color: "#6b6969"
  14. }
  15. GradientStop {
  16. position: 0.5
  17. color: "#625f5f"
  18. }
  19. GradientStop {
  20. position: 1
  21. color: "#0d0c0c"
  22. }
  23. }
  24. property string icon
  25. property string title
  26. property string description
  27. Image {
  28. id: imageSportBigIcon
  29. x: 28
  30. y: 26
  31. width: 218
  32. height: 218
  33. opacity: 0.24
  34. smooth: true
  35. source: icon
  36. SequentialAnimation on scale {
  37. loops: Animation.Infinite
  38. NumberAnimation {
  39. from: 0.7
  40. to: 1.1
  41. easing.type: Easing.InOutBounce
  42. duration: 3000
  43. }
  44. PauseAnimation { duration: 2000 }
  45. }
  46. }
  47. Text {
  48. id: textDetailedTitle
  49. x: 132
  50. y: 40
  51. width: 300
  52. height: 40
  53. color: "#fdfdfd"
  54. text: title
  55. style: Text.Raised
  56. font.family: "Tahoma"
  57. wrapMode: Text.WrapAtWordBoundaryOrAnywhere
  58. styleColor: "#b3aeae"
  59. font.bold: false
  60. font.pointSize: 19
  61. z: 2
  62. }
  63. Text {
  64. id: textDescriptionTitle
  65. x: 132
  66. y: 129
  67. width: 80
  68. height: 20
  69. color: "#ffffff"
  70. text: "Personal notes:"
  71. font.pointSize: 13
  72. }
  73. Flickable {
  74. id: flick
  75. width: 300; height: 150;
  76. x: 132
  77. y: 164
  78. contentWidth: edit.paintedWidth
  79. contentHeight: edit.paintedHeight
  80. clip: true
  81. flickableDirection: Flickable.VerticalFlick
  82. function ensureVisible(r)
  83. {
  84. if (contentX >= r.x)
  85. contentX = r.x;
  86. else if (contentX+width <= r.x+r.width)
  87. contentX = r.x+r.width-width;
  88. if (contentY >= r.y)
  89. contentY = r.y;
  90. else if (contentY+height <= r.y+r.height)
  91. contentY = r.y+r.height-height;
  92. }
  93. TextEdit {
  94. id: edit
  95. width: flick.width
  96. height: flick.height
  97. focus: true
  98. wrapMode: TextEdit.Wrap
  99. onCursorRectangleChanged: flick.ensureVisible(cursorRectangle)
  100. text: { if(description!="") return description;
  101. return "There was really nothing to say." }
  102. font.pointSize: 10
  103. color: "#ffffff"
  104. smooth: true
  105. readOnly: true
  106. }
  107. }
  108. }