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