Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick
- import QtQuick.Controls
- import QtQuick.Layouts
- import ThemeSwitcher
- import "../../../../../qml/mobile/components"
- import "../../../../../qml/common/components"
- //import "../../../../qml/common/controls"
- import "../../../../../qml/common/components/chat/common"
- import "../../../../../qml/common/components/chat/compact_chat"
- import "../../../../../base_qml/common/scripts/PokerGlobalScript.js" as PGS
- //import "../../../../../base_qml/common/components/chat/compact_chat"
- PForm {
- id: tableChatForm
- signal sizeChangedFromSmallToBig()
- signal sizeChangedFromBigToSmall()
- property int tableId: 0
- property int entryIdx: 0
- readonly property bool isMobile: pokerGlobalsModel.uiIdiomIsPhone
- function close( code ) {
- tableChatForm.closeForm( code )
- }
- anchors.fill: parent
- background: Rectangle{
- anchors.fill:parent
- //color:"transparent"
- //color:ThemeSwitcher.currentTheme.colorStyles.chatMessageBackgroundColor
- //opacity:0
- color: "#00000000"
- }
- header: NavigationBar {
- visible: false
- title.text: PGS.qsNls( "common-string.chat", "Chat" )
- closeButton.visible: true
- closeButton.onClicked: {
- tableChatForm.close( Dialog.Rejected )
- }
- }
- onVisibleChanged: {
- if( visible )
- appManager.analyticsPushScreenview( "TableChat" );
- }
- CompactChatForm{
- id: compactChatF
- visible:false
- }
- //Chat {
- //// id: chatForm
- //// visible: false
- //// model: tableChatForm.model
- //// property QtObject processor: chatForm.model.messageProcessor
- //// controlLayout.enabled: !model.isMessageSending
- //// listView.delegate: Loader {
- //// readonly property bool isSelfMessage: ( pokerGlobalsModel.authorized && model.authorId === pokerGlobalsModel.accountInfoModel.playerId )
- //// property QtObject chatModel: chatForm.model
- //// property QtObject processor: chatModel.messageProcessor
- //// property real listViewWidth: chatForm.listView.width
- //// ListView.onReused: {
- //// if( item && "parse" in item && typeof item.parse == "function" ) {
- //// item.parse()
- //// }
- //// }
- //// source: Qt.resolvedUrl( isSelfMessage
- //// ? "../../../../../qml/common/components/chat/table_chat/TableMessagesListViewOwnDelegate.qml"
- //// : "../../../../../qml/common/components/chat/table_chat/TableMessagesListViewDelegate.qml" )
- //// Component.onCompleted: {
- //// if( !contentItem.isDealer )
- //// chatModel.markEarlerMessagesAsRead()
- //// }
- //// }
- //// function sendMessage() {
- //// if( inputField.text && !chatForm.sending ) {
- //// chatForm.model.sendMessage( inputField.text )
- //// chatForm.sending = true;
- //// }
- //// }
- //// Connections {
- //// target: chatForm.model
- //// function onMessageSent( isSuccessfull ) {
- //// if( isSuccessfull )
- //// chatForm.inputField.clear()
- //// chatForm.sending = false;
- //// }
- //// }
- //// onVisibleChanged: {
- //// if ( visible ) {
- //// inputField.enabled = model.isSendingAllowed && !model.isMessageSending;1
- //// }
- //// }
- Component.onCompleted: {
- // inputField.enabled = model.isSendingAllowed && !model.isMessageSending;
- processor.cardSize = tableChatForm.isMobile ? Qt.size( 8, 18 ) : Qt.size( 14, 32 )
- processor.cardsUrl = Qt.binding( () => ThemeSwitcher.currentTableTheme.cardLayoutDataForGame( "gt.unknown" ).miniCardMatrixJsonSource )
- // processor.tableFormModel = Qt.binding( () => chatForm.model )
- processor.tableFormModel = Qt.binding( () => compactChatF.model )
- }
- //}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement