2020-05-26 21:56:56 +00:00
|
|
|
import QtQuick 2.12
|
2020-05-25 20:34:26 +00:00
|
|
|
import QtQuick.Controls 2.3
|
2020-05-26 21:56:56 +00:00
|
|
|
import QtQuick.Controls 2.12 as QQC2
|
2020-05-25 20:34:26 +00:00
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import Qt.labs.platform 1.1
|
2020-05-26 21:56:56 +00:00
|
|
|
import QtGraphicalEffects 1.12
|
2020-05-25 20:34:26 +00:00
|
|
|
import "../../../imports"
|
2020-05-27 21:09:12 +00:00
|
|
|
import "../../../shared"
|
2020-05-26 18:16:07 +00:00
|
|
|
import "./components"
|
2020-05-28 00:21:02 +00:00
|
|
|
import "./ContactsColumn"
|
2020-05-25 20:34:26 +00:00
|
|
|
|
2020-05-27 17:56:25 +00:00
|
|
|
Item {
|
2020-05-28 11:06:17 +00:00
|
|
|
property alias chatGroupsListViewCount: channelList.channelListCount
|
2020-05-28 11:19:18 +00:00
|
|
|
property alias searchStr: searchBox.searchStr
|
2020-05-25 20:34:26 +00:00
|
|
|
|
|
|
|
id: contactsColumn
|
|
|
|
width: 300
|
|
|
|
Layout.minimumWidth: 200
|
2020-05-27 18:40:58 +00:00
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: title
|
|
|
|
x: 772
|
|
|
|
text: qsTr("Chat")
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 17
|
|
|
|
font.bold: true
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
font.pixelSize: 17
|
|
|
|
}
|
2020-05-25 20:34:26 +00:00
|
|
|
|
2020-05-27 20:11:56 +00:00
|
|
|
PublicChatPopup {
|
|
|
|
id: publicChatPopup
|
|
|
|
}
|
|
|
|
|
2020-05-28 11:19:18 +00:00
|
|
|
SearchBox {
|
2020-05-27 18:40:58 +00:00
|
|
|
id: searchBox
|
|
|
|
}
|
2020-05-25 20:34:26 +00:00
|
|
|
|
2020-05-27 18:40:58 +00:00
|
|
|
Rectangle {
|
|
|
|
id: addChat
|
|
|
|
x: 183
|
|
|
|
width: 36
|
|
|
|
height: 36
|
|
|
|
color: Theme.blue
|
|
|
|
radius: 50
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 16
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 59
|
2020-05-25 20:34:26 +00:00
|
|
|
|
2020-05-27 18:40:58 +00:00
|
|
|
Text {
|
|
|
|
id: addChatLbl
|
|
|
|
color: "#ffffff"
|
|
|
|
text: qsTr("+")
|
|
|
|
anchors.verticalCenterOffset: -1
|
|
|
|
anchors.horizontalCenterOffset: 1
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
lineHeight: 1
|
|
|
|
fontSizeMode: Text.FixedSize
|
|
|
|
font.bold: true
|
|
|
|
font.pixelSize: 28
|
|
|
|
state: "default"
|
|
|
|
rotation: 0
|
|
|
|
states: [
|
|
|
|
State {
|
|
|
|
name: "default"
|
|
|
|
PropertyChanges {
|
|
|
|
target: addChatLbl
|
|
|
|
rotation: 0
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: "rotated"
|
|
|
|
PropertyChanges {
|
|
|
|
target: addChatLbl
|
|
|
|
rotation: 45
|
|
|
|
}
|
2020-05-25 20:34:26 +00:00
|
|
|
}
|
2020-05-27 18:40:58 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
transitions: [
|
|
|
|
Transition {
|
|
|
|
from: "default"
|
|
|
|
to: "rotated"
|
|
|
|
RotationAnimation {
|
|
|
|
duration: 150
|
|
|
|
direction: RotationAnimation.Clockwise
|
|
|
|
easing.type: Easing.InCubic
|
2020-05-27 16:24:24 +00:00
|
|
|
}
|
2020-05-27 18:40:58 +00:00
|
|
|
},
|
|
|
|
Transition {
|
|
|
|
from: "rotated"
|
|
|
|
to: "default"
|
|
|
|
RotationAnimation {
|
|
|
|
duration: 150
|
|
|
|
direction: RotationAnimation.Counterclockwise
|
|
|
|
easing.type: Easing.OutCubic
|
2020-05-27 16:24:24 +00:00
|
|
|
}
|
2020-05-25 20:34:26 +00:00
|
|
|
}
|
2020-05-27 18:40:58 +00:00
|
|
|
]
|
|
|
|
}
|
2020-05-25 20:34:26 +00:00
|
|
|
|
2020-05-27 18:40:58 +00:00
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
2020-05-28 02:26:01 +00:00
|
|
|
cursorShape: Qt.PointingHandCursor
|
2020-05-27 18:40:58 +00:00
|
|
|
onClicked: {
|
|
|
|
addChatLbl.state = "rotated"
|
|
|
|
let x = addChatLbl.x + addChatLbl.width / 2 - newChatMenu.width / 2
|
|
|
|
newChatMenu.popup(x, addChatLbl.height + 10)
|
|
|
|
}
|
|
|
|
|
2020-05-27 20:42:24 +00:00
|
|
|
PopupMenu {
|
2020-05-27 18:40:58 +00:00
|
|
|
id: newChatMenu
|
|
|
|
QQC2.Action {
|
|
|
|
text: qsTr("Start new chat")
|
|
|
|
icon.source: "../../img/new_chat.svg"
|
|
|
|
onTriggered: {
|
|
|
|
console.log("TODO: Start new chat")
|
2020-05-27 16:24:24 +00:00
|
|
|
}
|
2020-05-27 18:40:58 +00:00
|
|
|
}
|
|
|
|
QQC2.Action {
|
|
|
|
text: qsTr("Start group chat")
|
|
|
|
icon.source: "../../img/group_chat.svg"
|
|
|
|
onTriggered: {
|
|
|
|
console.log("TODO: Start group chat")
|
2020-05-27 16:24:24 +00:00
|
|
|
}
|
2020-05-27 18:40:58 +00:00
|
|
|
}
|
|
|
|
QQC2.Action {
|
|
|
|
text: qsTr("Join public chat")
|
|
|
|
icon.source: "../../img/public_chat.svg"
|
2020-05-27 20:11:56 +00:00
|
|
|
onTriggered: publicChatPopup.open()
|
2020-05-27 18:40:58 +00:00
|
|
|
}
|
|
|
|
onAboutToHide: {
|
|
|
|
addChatLbl.state = "default"
|
|
|
|
}
|
2020-05-25 20:34:26 +00:00
|
|
|
}
|
|
|
|
}
|
2020-05-27 16:24:24 +00:00
|
|
|
}
|
2020-05-25 20:34:26 +00:00
|
|
|
|
2020-05-27 16:24:24 +00:00
|
|
|
StackLayout {
|
2020-05-27 18:40:58 +00:00
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 0
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 0
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 0
|
|
|
|
anchors.top: searchBox.bottom
|
|
|
|
anchors.topMargin: 16
|
|
|
|
|
2020-05-28 11:06:17 +00:00
|
|
|
currentIndex: channelList.channelListCount > 0 ? 1 : 0
|
2020-05-27 16:24:24 +00:00
|
|
|
|
2020-05-28 00:21:02 +00:00
|
|
|
EmptyView {}
|
2020-05-26 18:16:07 +00:00
|
|
|
|
2020-05-28 11:06:17 +00:00
|
|
|
ChannelList {
|
|
|
|
id: channelList
|
2020-05-27 16:24:24 +00:00
|
|
|
}
|
|
|
|
}
|
2020-05-25 20:34:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
2020-05-27 17:56:25 +00:00
|
|
|
D{i:0;formeditorColor:"#ffffff";height:770;width:300}
|
2020-05-25 20:34:26 +00:00
|
|
|
}
|
|
|
|
##^##*/
|