codebutton.qml 906 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2011 Nokia Corporation.
  3. */
  4. import Qt 4.7
  5. Rectangle {
  6. id: codeButton
  7. property alias title: titleText.text
  8. property string search
  9. width: titleText.width + 10; height: 50
  10. opacity: 1
  11. color: "#999999"//"darkgray"
  12. radius: 6
  13. clip: true
  14. SequentialAnimation {
  15. id: pressAnimation
  16. PropertyAnimation { target: codeButton; properties: "scale"; to: 0.9; duration: 100 }
  17. ParallelAnimation {
  18. PropertyAnimation { target: codeButton; properties: "scale"; to: 1.0; duration: 100 }
  19. ScriptAction { script: textEditor.findCode(codeButton.search) }
  20. }
  21. }
  22. Text {
  23. id: titleText
  24. anchors.centerIn: parent
  25. text: codeButton.title
  26. color: "white"
  27. font.pixelSize: 13
  28. }
  29. MouseArea {
  30. anchors.fill: parent
  31. onClicked: { pressAnimation.start() }
  32. }
  33. }