StickedButton.qml 554 B

12345678910111213141516171819202122232425
  1. // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
  2. import QtQuick 1.1
  3. Button {
  4. property bool is_pressed: false
  5. signal sigState(string key, bool state)
  6. MouseArea {
  7. anchors.fill: parent
  8. onPressed: {
  9. is_pressed = !is_pressed
  10. if (is_pressed)
  11. {
  12. grad = style.grad_but_sticked
  13. }
  14. else
  15. {
  16. grad = style.grad_but_def
  17. }
  18. sigState(currentKey(), is_pressed)
  19. }
  20. }
  21. }