chore: fix anchor warning in ContactColumn and cleanup

This commit is contained in:
Jonathan Rainville 2020-05-27 12:24:24 -04:00 committed by Iuri Matias
parent 084c96afff
commit 5b14982393
1 changed files with 391 additions and 379 deletions

View File

@ -7,25 +7,22 @@ import QtGraphicalEffects 1.12
import "../../../imports"
import "./components"
Item {
Column {
property alias chatGroupsListViewCount: chatGroupsListView.count
property alias searchStr: searchText.text
id: contactsColumn
width: 300
height: parent.height
// height: parent.height
Layout.minimumWidth: 200
ColumnLayout {
anchors.fill: parent
Item {
Layout.preferredHeight: 100
Layout.fillHeight: false
Layout.fillWidth: true
Text {
id: element
id: title
x: 772
text: qsTr("Chat")
anchors.top: parent.top
@ -105,11 +102,17 @@ Item {
states: [
State {
name: "default"
PropertyChanges { target: addChatLbl; rotation: 0 }
PropertyChanges {
target: addChatLbl
rotation: 0
}
},
State {
name: "rotated"
PropertyChanges { target: addChatLbl; rotation: 45 }
PropertyChanges {
target: addChatLbl
rotation: 45
}
}
]
@ -118,7 +121,7 @@ Item {
from: "default"
to: "rotated"
RotationAnimation {
duration: 150;
duration: 150
direction: RotationAnimation.Clockwise
easing.type: Easing.InCubic
}
@ -127,13 +130,12 @@ Item {
from: "rotated"
to: "default"
RotationAnimation {
duration: 150;
duration: 150
direction: RotationAnimation.Counterclockwise
easing.type: Easing.OutCubic
}
}
]
}
MouseArea {
@ -165,8 +167,9 @@ Item {
text: qsTr("Join public chat")
icon.source: "../../img/public_chat.svg"
onTriggered: {
chatGroupsListView.currentIndex = chatsModel.joinChat(searchText.text);
searchText.text = "";
chatGroupsListView.currentIndex = chatsModel.joinChat(
searchText.text)
searchText.text = ""
}
}
onAboutToHide: {
@ -239,7 +242,6 @@ Item {
color: "#22000000"
}
}
}
}
}
@ -252,24 +254,16 @@ Item {
currentIndex: chatGroupsListView.count > 0 ? 1 : 0
Item {
id: element1
id: suggestionsContainer
Layout.fillHeight: true
Layout.fillWidth: true
ColumnLayout {
Row {
id: description
anchors.right: parent.right
anchors.rightMargin: 20
anchors.left: parent.left
anchors.leftMargin: 20
anchors.top: parent.top
anchors.topMargin: 20
Layout.fillHeight: true
Layout.fillWidth: true
Row {
id: description
Layout.fillHeight: false
Layout.fillWidth: true
width: parent.width
Text {
width: parent.width
@ -286,12 +280,10 @@ Item {
RowLayout {
id: row
Layout.fillHeight: false
Layout.fillWidth: true
anchors.right: parent.right
anchors.rightMargin: 0
anchors.rightMargin: 20
anchors.left: parent.left
anchors.leftMargin: 0
anchors.leftMargin: 20
anchors.top: description.bottom
anchors.topMargin: 20
@ -300,21 +292,43 @@ Item {
Layout.fillWidth: true
spacing: 6
SuggestedChannel { channel: "introductions" }
SuggestedChannel { channel: "chitchat" }
SuggestedChannel { channel: "status" }
SuggestedChannel { channel: "crypto" }
SuggestedChannel { channel: "tech" }
SuggestedChannel { channel: "music" }
SuggestedChannel { channel: "movies" }
SuggestedChannel { channel: "test" }
SuggestedChannel { channel: "test2" }
SuggestedChannel {
channel: "introductions"
}
SuggestedChannel {
channel: "chitchat"
}
SuggestedChannel {
channel: "status"
}
SuggestedChannel {
channel: "crypto"
}
SuggestedChannel {
channel: "tech"
}
SuggestedChannel {
channel: "music"
}
SuggestedChannel {
channel: "movies"
}
SuggestedChannel {
channel: "test"
}
SuggestedChannel {
channel: "test2"
}
}
}
}
}
Item {
id: chatGroupsContainer
Layout.fillWidth: true
Layout.fillHeight: true
Component {
id: chatViewDelegate
@ -329,12 +343,13 @@ Item {
anchors.leftMargin: Theme.padding
radius: 8
// Hide the box if it is filtered out
property bool isVisible: searchStr == "" || name.includes(searchStr)
property bool isVisible: searchStr == "" || name.includes(
searchStr)
visible: isVisible ? true : false
height: isVisible ? 64 : 0
MouseArea {
cursorShape: Qt.PointingHandCursor;
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: {
chatsModel.setActiveChannelByIndex(index)
@ -423,13 +438,10 @@ Item {
}
}
}
}
}
/*##^##
Designer {
D{i:0;height:770;width:300}
D{i:0;height:770;width:300;formeditorColor:"#ffffff"}
}
##^##*/