Skip to content

Commit

Permalink
[qml-desktop] Add chat list. Closed #21
Browse files Browse the repository at this point in the history
  • Loading branch information
RostovtsevDanila committed May 25, 2020
1 parent ab6130f commit b13dd17
Show file tree
Hide file tree
Showing 7 changed files with 148 additions and 1 deletion.
5 changes: 5 additions & 0 deletions application/qml/desktop/ChatList.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import QtQuick 2.0

Item {

}
39 changes: 39 additions & 0 deletions application/qml/desktop/ChatPage.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import QtQuick 2.0

Item {
id: root
anchors.fill: parent

Row {
anchors.fill: parent

ContactList {
id: contactList
height: parent.height
width: 400
}

Column {
height: parent.height
width: root.width - contactList.width

Rectangle {
id: toolBar
height: 70
width: parent.width
}

ChatList {
id: chatList
height: parent.height - (toolBar.height + messageZone.height)
width: parent.width
}

MessageZone {
id: messageZone
height: 40
width: parent.width
}
}
}
}
57 changes: 57 additions & 0 deletions application/qml/desktop/MessageZone.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import QtQuick 2.13
import QtQuick.Controls 2.5
import QtGraphicalEffects 1.12

Rectangle {
id: root

border.color: "gray"
radius: 2

Row {
anchors.fill: parent
spacing: 2

TextEdit {
id: txtPlane
width: parent.width - sendButton.width
font.pixelSize: 20
leftPadding: 10
topPadding: 5
focus: true

onTextChanged: {
/*
* Here will be message string variable
*/
}
}

Rectangle {
id: sendButton
height: parent.height - 2
width: height
anchors.verticalCenter: parent.verticalCenter
color: "transparent"

Image {
id:buttonIcon
anchors.fill: parent
fillMode: Image.PreserveAspectFit
source: "icons/send-button.svg"
}

ColorOverlay {
id: buttonEffect
anchors.fill: buttonIcon
source: buttonIcon
color: sendButtonArea.pressed ? "black" : "gray"
}

MouseArea {
id: sendButtonArea
anchors.fill: parent
}
}
}
}
42 changes: 42 additions & 0 deletions application/qml/desktop/icons/send-button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added application/qml/desktop/icons/send.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion application/qml/desktop/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Window {
}
}

Loader {
Loader {
id: mainPageLoader
anchors.fill: parent
}
Expand Down
4 changes: 4 additions & 0 deletions application/qml/desktop/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@
<file>icons/Title.svg</file>
<file>HomePage.qml</file>
<file>AuthenticationPage.qml</file>
<file>ChatPage.qml</file>
<file>ChatList.qml</file>
<file>MessageZone.qml</file>
<file>icons/send-button.svg</file>
</qresource>
</RCC>

0 comments on commit b13dd17

Please sign in to comment.