Info.qml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /**
  2. * Copyright (c) 2011-2012 Nokia Corporation.
  3. */
  4. import QtQuick 1.1
  5. Item {
  6. id: infoContainer
  7. opacity: 0
  8. property int parentWidth
  9. property int parentHeight
  10. function showInfo(width, height) {
  11. parentWidth = width;
  12. parentHeight = height;
  13. infoContainer.opacity = 0;
  14. infoContainer.width = parentWidth * 0.1;
  15. infoContainer.height = parentHeight * 0.2;
  16. infoContainer.x = parentWidth * 0.5;
  17. infoContainer.y = parentHeight * 0.5;
  18. infoAnim.restart();
  19. }
  20. Image {
  21. source: "qrc:/gfx/info_noshadow.png"
  22. smooth: true
  23. anchors.fill: parent
  24. }
  25. Image {
  26. id: closeImage
  27. source: "qrc:/gfx/info_close.png"
  28. smooth: true
  29. anchors.bottom: parent.bottom
  30. anchors.bottomMargin: 40
  31. anchors.horizontalCenter: parent.horizontalCenter
  32. }
  33. ParallelAnimation {
  34. id: infoAnim
  35. NumberAnimation { target: infoContainer; property: "opacity"; from:0; to: 1; duration: 1000 }
  36. PropertyAction { target: infoContainer; property: "opacity"; value: 1 }
  37. NumberAnimation { target: infoContainer; property: "width"; to: parentWidth; duration:1000 }
  38. NumberAnimation { target: infoContainer; property: "height"; to: parentHeight; duration: 1000;
  39. easing.type: Easing.InOutElastic; easing.amplitude: 2.0; easing.period: 1.5}
  40. NumberAnimation { target: infoContainer; property: "x"; to: 0; duration: 1000 }
  41. NumberAnimation { target: infoContainer; property: "y"; to: 0; duration: 1000 }
  42. }
  43. NumberAnimation {
  44. id: infoEndAnim
  45. target: infoContainer; property: "opacity"; from: 1; to: 0; duration: 1000
  46. }
  47. MouseArea {
  48. anchors.fill: parent
  49. }
  50. Flickable {
  51. id: flickable
  52. anchors {
  53. fill: parent
  54. leftMargin: 40
  55. rightMargin: 40
  56. topMargin: 150
  57. bottomMargin: 40
  58. }
  59. contentWidth: width
  60. contentHeight: infoText.height
  61. clip: true
  62. Text {
  63. id: infoText
  64. width: flickable.width
  65. color: "#602f05"
  66. font.pixelSize: flickable.width * 0.05
  67. text: "<a href=\"http://projects.developer.nokia.com/mirrorhouse\">"
  68. + "<font color=\"#000000\">MirrorHouse v1.3</font></a><br><br>"
  69. + "The MirrorHouse Qt Quick application demonstrates "
  70. + "QCamera frame manipulation at runtime with "
  71. + "different mirror effects.<br>"
  72. + "Swipe the mirrors from right to left to get more mirrors visible. "
  73. + "Tap the mirror for turning and pinch for zooming the mirror.<br><br>"
  74. + "Copyright 2011-2012 Nokia Corporation. All rights reserved.";
  75. wrapMode: Text.WordWrap
  76. onLinkActivated: Qt.openUrlExternally(link);
  77. }
  78. }
  79. MouseArea {
  80. anchors.fill: closeImage
  81. onClicked: {
  82. infoEndAnim.restart();
  83. }
  84. }
  85. }