Warning, /rolisteam/rolisteam/src/libraries/qml_views/InstantMessaging/InstantMessagingMain.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick
0002 import QtQuick.Controls
0003 import QtQuick.Layouts
0004 import QtMultimedia
0005 import InstantMessaging
0006 import Customization
0007 import org.rolisteam.InstantMessaging
0008 
0009 Pane {
0010     id: root
0011     anchors.fill: parent
0012     property QtObject styleSheet: Theme.styleSheet("InstantMessaging")
0013 
0014     padding: 0
0015 
0016     SideMenu {
0017         id: sideMenu
0018         height: parent.height
0019         edge: Qt.RightEdge
0020         onNightModeChanged: Theme.nightMode = sideMenu.nightMode
0021     }
0022 
0023     AddChatRoomDialog {
0024         id: newChatRoom
0025         x: -width+parent.width
0026         model: InstantMessagerManager.ctrl.playerModel
0027         onChatRoomAdded: {
0028             InstantMessagerManager.ctrl.addExtraChatroom(newChatRoom.title, newChatRoom.all, newChatRoom.recipiants)
0029         }
0030     }
0031     Menu {
0032         id: menu
0033         x: -width+parent.width
0034         Action {
0035             text: qsTr("Settings")
0036             onTriggered: sideMenu.open()
0037         }
0038         Action {
0039             text: qsTr("Add chatroom")
0040             onTriggered: newChatRoom.open()
0041         }
0042     }
0043 
0044     SplitView {
0045         anchors.fill: parent
0046         Repeater {
0047             id: reaper
0048             model: InstantMessagerManager.ctrl.mainModel
0049             property real headerHeight: 0
0050             delegate: ChatView {
0051                 chatroomModel: model.filterModel
0052                 styleSheet: root.styleSheet
0053                 onZoomChanged: sideMenu.fontFactor += delta
0054                 SplitView.minimumWidth: root.styleSheet.minimumWidth
0055                 SplitView.preferredWidth: root.width/reaper.count
0056                 SplitView.fillHeight: true
0057                 SplitView.fillWidth: true
0058                 tabBarRightMargin: index == reaper.count-1 ? listButton.width : 0
0059                 Component.onCompleted: reaper.headerHeight = tabBarHeight
0060                 localPersonModel: InstantMessagerManager.ctrl.localPersonModel
0061                 onAddChat: InstantMessagerManager.ctrl.addExtraChatroom(title, all, recipiants)
0062                 onSplit: InstantMessagerManager.ctrl.splitScreen(uuid, model.index)
0063                 onDetach: InstantMessagerManager.ctrl.detach(uuid, index, model.index)
0064             }
0065         }
0066     }
0067 
0068     ToolButton {
0069         id: listButton
0070         anchors.top: parent.top
0071         anchors.right: parent.right
0072         height: reaper.headerHeight
0073         icon.name: "menu-rounded-solid"
0074         onClicked: menu.open()
0075     }
0076 }
0077