VirtualPhoneForm.ui.qml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. import QtQuick 2.7
  2. import QtQuick.Controls 2.0
  3. import QtPositioning 5.7
  4. Item {
  5. width: 400
  6. height: 400
  7. property alias virtualPhoneDisplay: virtualPhoneDisplay
  8. property alias key_2: key_2
  9. property alias key_3: key_3
  10. property alias key_4: key_4
  11. property alias key_5: key_5
  12. property alias key_6: key_6
  13. property alias key_7: key_7
  14. property alias key_8: key_8
  15. property alias key_asterisk: key_asterisk
  16. property alias key_9: key_9
  17. property alias key_0: key_0
  18. property alias key_octothorpe: key_octothorpe
  19. property alias eraseCharacter: eraseCharacter
  20. property alias key_1: key_1
  21. Item {
  22. id: virtualPhoneLayout
  23. //spacing: 1
  24. anchors.bottomMargin: 40
  25. anchors.fill: parent
  26. Item {
  27. id: virtualPhoneDisplayLayout
  28. width: parent.width
  29. height: 70
  30. //spacing: 1
  31. anchors.left: parent.left
  32. anchors.leftMargin: 0
  33. anchors.top: parent.top
  34. anchors.topMargin: 0
  35. TextField {
  36. id: virtualPhoneDisplay
  37. font.pointSize: this.width > 600 ? 40 : (this.width > 300 ? 20 : 14)
  38. placeholderText: qsTr("Введите номер")
  39. horizontalAlignment: Text.AlignRight
  40. anchors.rightMargin: 40
  41. anchors.fill: parent
  42. }
  43. Button {
  44. id: eraseCharacter
  45. width: 40
  46. height: parent.height - 1
  47. text: qsTr("<")
  48. anchors.right: parent.right
  49. anchors.rightMargin: 0
  50. }
  51. }
  52. Text {
  53. id: virtualPhoneDistinationInfo
  54. height: (parent.height - 150) / 3 - 1
  55. text: qsTr("")
  56. anchors.top: parent.top
  57. anchors.topMargin: 70
  58. anchors.right: parent.right
  59. anchors.rightMargin: 0
  60. anchors.left: parent.left
  61. anchors.leftMargin: 0
  62. font.pixelSize: 12
  63. }
  64. Grid {
  65. id: virtualPhonePad
  66. width: (parent.width > parent.height ? parent.height : parent.width) - 1
  67. anchors.topMargin: (parent.height - 150) / 3 + 70
  68. anchors.left: parent.left
  69. anchors.leftMargin: 0
  70. anchors.top: parent.top
  71. anchors.bottom: parent.bottom
  72. anchors.bottomMargin: 60
  73. spacing: 1
  74. layoutDirection: Qt.LeftToRight
  75. flow: Grid.LeftToRight
  76. columns: 3
  77. Button {
  78. id: key_1
  79. width: parent.width / 3 - parent.spacing
  80. height: parent.height / 4 - parent.spacing
  81. text: qsTr("1")
  82. transformOrigin: Item.Center
  83. font.pixelSize: (parent.width > parent.height ? parent.height : parent.width)/7
  84. }
  85. Button {
  86. id: key_2
  87. width: parent.width / 3 - parent.spacing
  88. height: parent.height / 4 - parent.spacing
  89. text: qsTr("2")
  90. font.pixelSize: (parent.width > parent.height ? parent.height : parent.width)/7
  91. }
  92. Button {
  93. id: key_3
  94. width: parent.width / 3 - parent.spacing
  95. height: parent.height / 4 - parent.spacing
  96. text: qsTr("3")
  97. font.pixelSize: (parent.width > parent.height ? parent.height : parent.width)/7
  98. }
  99. Button {
  100. id: key_4
  101. width: parent.width / 3 - parent.spacing
  102. height: parent.height / 4 - parent.spacing
  103. text: qsTr("4")
  104. font.pixelSize: (parent.width > parent.height ? parent.height : parent.width)/7
  105. }
  106. Button {
  107. id: key_5
  108. width: parent.width / 3 - parent.spacing
  109. height: parent.height / 4 - parent.spacing
  110. text: qsTr("5")
  111. font.pixelSize: (parent.width > parent.height ? parent.height : parent.width)/7
  112. }
  113. Button {
  114. id: key_6
  115. width: parent.width / 3 - parent.spacing
  116. height: parent.height / 4 - parent.spacing
  117. text: qsTr("6")
  118. font.pixelSize: (parent.width > parent.height ? parent.height : parent.width)/7
  119. }
  120. Button {
  121. id: key_7
  122. width: parent.width / 3 - parent.spacing
  123. height: parent.height / 4 - parent.spacing
  124. text: qsTr("7")
  125. font.pixelSize: (parent.width > parent.height ? parent.height : parent.width)/7
  126. }
  127. Button {
  128. id: key_8
  129. x: parent.width / 3
  130. y: (parent.height * 2 / 4)
  131. width: parent.width / 3 - parent.spacing
  132. height: parent.height / 4 - parent.spacing
  133. text: qsTr("8")
  134. font.pixelSize: (parent.width > parent.height ? parent.height : parent.width)/7
  135. }
  136. Button {
  137. id: key_9
  138. width: parent.width / 3 - parent.spacing
  139. height: parent.height / 4 - parent.spacing
  140. text: qsTr("9")
  141. font.pixelSize: (parent.width > parent.height ? parent.height : parent.width)/7
  142. }
  143. Button {
  144. id: key_asterisk
  145. width: parent.width / 3 - parent.spacing
  146. height: parent.height / 4 - parent.spacing
  147. text: qsTr("*")
  148. font.pixelSize: (parent.width > parent.height ? parent.height : parent.width)/7
  149. }
  150. Button {
  151. id: key_0
  152. width: parent.width / 3 - parent.spacing
  153. height: parent.height / 4 - parent.spacing
  154. text: qsTr("0")
  155. font.pixelSize: (parent.width > parent.height ? parent.height : parent.width)/7
  156. }
  157. Button {
  158. id: key_octothorpe
  159. width: parent.width / 3 - parent.spacing
  160. height: parent.height / 4 - parent.spacing
  161. text: qsTr("#")
  162. font.pixelSize: (parent.width > parent.height ? parent.height : parent.width)/7
  163. }
  164. }
  165. Item {
  166. id: virtualPhoneControls
  167. y: 0
  168. width: parent.width
  169. height: 60
  170. //spacing: 1
  171. anchors.left: parent.left
  172. anchors.leftMargin: 0
  173. anchors.bottom: parent.bottom
  174. anchors.bottomMargin: 0
  175. Switch {
  176. id: callFromPBX
  177. width: 220
  178. text: qsTr("Вызов со стороны АТС")
  179. anchors.bottom: parent.bottom
  180. anchors.bottomMargin: 0
  181. anchors.top: parent.top
  182. anchors.topMargin: 0
  183. anchors.left: parent.left
  184. anchors.leftMargin: 0
  185. }
  186. Button {
  187. id: callButton
  188. text: qsTr("ВЫЗОВ")
  189. anchors.leftMargin: 220
  190. anchors.fill: parent
  191. }
  192. }
  193. BusyIndicator {
  194. id: busyIndicator
  195. visible: false
  196. anchors.fill: parent
  197. }
  198. }
  199. Item {
  200. id: pageNameLayout
  201. height: 40
  202. anchors.right: parent.right
  203. anchors.rightMargin: 0
  204. anchors.left: parent.left
  205. anchors.leftMargin: 0
  206. anchors.bottom: parent.bottom
  207. anchors.bottomMargin: 0
  208. Text {
  209. id: pageName
  210. text: qsTr("Виртуальный телефон")
  211. font.pixelSize: parent.width > 300 ? 24 : 12
  212. verticalAlignment: Text.AlignVCenter
  213. horizontalAlignment: Text.AlignHCenter
  214. renderType: Text.QtRendering
  215. font.capitalization: Font.MixedCase
  216. anchors.fill: parent
  217. }
  218. }
  219. }