RusLatButton.qml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
  2. import QtQuick 1.1
  3. Button {
  4. id: root
  5. width: style.but_width_and_half
  6. fixed: true
  7. signal sigLanguageSwitch (string lng)
  8. Text {
  9. id: rus
  10. property string type: "ru"
  11. anchors.verticalCenter: parent.verticalCenter
  12. anchors.right: sep.left
  13. anchors.rightMargin: 4
  14. font.pixelSize: root.style.font_size
  15. color: lang == type ? root.style.col_label_active : root.style.col_label_inactive
  16. text: "Rus"
  17. Behavior on color {
  18. ColorAnimation { duration: 500 }
  19. }
  20. }
  21. Text {
  22. id: sep
  23. anchors.centerIn: parent
  24. font.pixelSize: root.style.font_size
  25. color: root.style.col_label_def
  26. text: "/"
  27. }
  28. Text {
  29. id: lat
  30. property string type: "en"
  31. anchors.verticalCenter: parent.verticalCenter
  32. anchors.left: sep.right
  33. anchors.leftMargin: 4
  34. font.pixelSize: root.style.font_size
  35. color: lang == type ? root.style.col_label_active : root.style.col_label_inactive
  36. text: "Lat"
  37. Behavior on color {
  38. ColorAnimation { duration: 500 }
  39. }
  40. }
  41. MouseArea {
  42. anchors.fill: parent
  43. onPressed:
  44. {
  45. if (lang == "en")
  46. {
  47. lang = "ru"
  48. }
  49. else
  50. {
  51. lang = "en"
  52. }
  53. root.sigLanguageSwitch(lang)
  54. }
  55. }
  56. }