Advertisement
Dmitriiiiiqiq

CHT

Apr 24th, 2023
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.11 KB | None | 0 0
  1. import QtQuick
  2. import QtQuick.Controls
  3. import QtQuick.Layouts
  4. import ThemeSwitcher
  5. import "../../../../../qml/mobile/components"
  6. import "../../../../../qml/common/components"
  7. //import "../../../../qml/common/controls"
  8. import "../../../../../qml/common/components/chat/common"
  9. import "../../../../../qml/common/components/chat/compact_chat"
  10. import "../../../../../base_qml/common/scripts/PokerGlobalScript.js" as PGS
  11. //import "../../../../../base_qml/common/components/chat/compact_chat"
  12.  
  13.  
  14. PForm {
  15. id: tableChatForm
  16.  
  17. signal sizeChangedFromSmallToBig()
  18. signal sizeChangedFromBigToSmall()
  19.  
  20. property int tableId: 0
  21. property int entryIdx: 0
  22. readonly property bool isMobile: pokerGlobalsModel.uiIdiomIsPhone
  23.  
  24. function close( code ) {
  25. tableChatForm.closeForm( code )
  26. }
  27.  
  28. anchors.fill: parent
  29. background: Rectangle{
  30. anchors.fill:parent
  31. //color:"transparent"
  32. //color:ThemeSwitcher.currentTheme.colorStyles.chatMessageBackgroundColor
  33. //opacity:0
  34. color: "#00000000"
  35.  
  36. }
  37.  
  38.  
  39.  
  40. header: NavigationBar {
  41. visible: false
  42. title.text: PGS.qsNls( "common-string.chat", "Chat" )
  43.  
  44. closeButton.visible: true
  45. closeButton.onClicked: {
  46. tableChatForm.close( Dialog.Rejected )
  47. }
  48. }
  49.  
  50. onVisibleChanged: {
  51. if( visible )
  52. appManager.analyticsPushScreenview( "TableChat" );
  53. }
  54.  
  55. CompactChatForm{
  56. id: compactChatF
  57.  
  58. visible:false
  59.  
  60. }
  61.  
  62. //Chat {
  63. //// id: chatForm
  64. //// visible: false
  65.  
  66. //// model: tableChatForm.model
  67.  
  68. //// property QtObject processor: chatForm.model.messageProcessor
  69.  
  70. //// controlLayout.enabled: !model.isMessageSending
  71.  
  72. //// listView.delegate: Loader {
  73. //// readonly property bool isSelfMessage: ( pokerGlobalsModel.authorized && model.authorId === pokerGlobalsModel.accountInfoModel.playerId )
  74. //// property QtObject chatModel: chatForm.model
  75. //// property QtObject processor: chatModel.messageProcessor
  76.  
  77. //// property real listViewWidth: chatForm.listView.width
  78.  
  79. //// ListView.onReused: {
  80. //// if( item && "parse" in item && typeof item.parse == "function" ) {
  81. //// item.parse()
  82. //// }
  83. //// }
  84.  
  85. //// source: Qt.resolvedUrl( isSelfMessage
  86. //// ? "../../../../../qml/common/components/chat/table_chat/TableMessagesListViewOwnDelegate.qml"
  87. //// : "../../../../../qml/common/components/chat/table_chat/TableMessagesListViewDelegate.qml" )
  88.  
  89. //// Component.onCompleted: {
  90. //// if( !contentItem.isDealer )
  91. //// chatModel.markEarlerMessagesAsRead()
  92. //// }
  93. //// }
  94.  
  95. //// function sendMessage() {
  96. //// if( inputField.text && !chatForm.sending ) {
  97. //// chatForm.model.sendMessage( inputField.text )
  98. //// chatForm.sending = true;
  99. //// }
  100. //// }
  101.  
  102. //// Connections {
  103. //// target: chatForm.model
  104.  
  105. //// function onMessageSent( isSuccessfull ) {
  106. //// if( isSuccessfull )
  107. //// chatForm.inputField.clear()
  108.  
  109. //// chatForm.sending = false;
  110.  
  111. //// }
  112. //// }
  113.  
  114. //// onVisibleChanged: {
  115. //// if ( visible ) {
  116. //// inputField.enabled = model.isSendingAllowed && !model.isMessageSending;1
  117. //// }
  118. //// }
  119.  
  120. Component.onCompleted: {
  121. // inputField.enabled = model.isSendingAllowed && !model.isMessageSending;
  122.  
  123. processor.cardSize = tableChatForm.isMobile ? Qt.size( 8, 18 ) : Qt.size( 14, 32 )
  124. processor.cardsUrl = Qt.binding( () => ThemeSwitcher.currentTableTheme.cardLayoutDataForGame( "gt.unknown" ).miniCardMatrixJsonSource )
  125. // processor.tableFormModel = Qt.binding( () => chatForm.model )
  126. processor.tableFormModel = Qt.binding( () => compactChatF.model )
  127. }
  128.  
  129. //}
  130.  
  131. }
  132.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement