From 839afd6356efdbbfe3926a5f5fda622f32b722e2 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 27 May 2020 20:21:02 -0400 Subject: [PATCH] extract contacts EmptyView into its own file --- ui/app/AppLayouts/Chat/ContactsColumn.qml | 71 +----------------- .../Chat/ContactsColumn/EmptyView.qml | 74 +++++++++++++++++++ ui/app/AppLayouts/Chat/ContactsColumn/qmldir | 1 + 3 files changed, 77 insertions(+), 69 deletions(-) create mode 100644 ui/app/AppLayouts/Chat/ContactsColumn/EmptyView.qml create mode 100644 ui/app/AppLayouts/Chat/ContactsColumn/qmldir diff --git a/ui/app/AppLayouts/Chat/ContactsColumn.qml b/ui/app/AppLayouts/Chat/ContactsColumn.qml index 7caef9be8..1ab2042cd 100644 --- a/ui/app/AppLayouts/Chat/ContactsColumn.qml +++ b/ui/app/AppLayouts/Chat/ContactsColumn.qml @@ -7,6 +7,7 @@ import QtGraphicalEffects 1.12 import "../../../imports" import "../../../shared" import "./components" +import "./ContactsColumn" Item { property alias chatGroupsListViewCount: chatGroupsListView.count @@ -188,75 +189,7 @@ Item { currentIndex: chatGroupsListView.count > 0 ? 1 : 0 - Item { - id: suggestionsContainer - Layout.fillHeight: true - Layout.fillWidth: true - - Row { - id: description - anchors.right: parent.right - anchors.rightMargin: 20 - anchors.left: parent.left - anchors.leftMargin: 20 - - Text { - width: parent.width - text: qsTr("Follow your interests in one of the many Public Chats.") - font.pointSize: 15 - wrapMode: Text.WordWrap - verticalAlignment: Text.AlignTop - horizontalAlignment: Text.AlignHCenter - fontSizeMode: Text.FixedSize - renderType: Text.QtRendering - onLinkActivated: console.log(link) - } - } - - RowLayout { - id: row - anchors.right: parent.right - anchors.rightMargin: 20 - anchors.left: parent.left - anchors.leftMargin: 20 - anchors.top: description.bottom - anchors.topMargin: 20 - - Flow { - Layout.fillHeight: false - 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" - } - } - } - } + EmptyView {} Item { id: chatGroupsContainer diff --git a/ui/app/AppLayouts/Chat/ContactsColumn/EmptyView.qml b/ui/app/AppLayouts/Chat/ContactsColumn/EmptyView.qml new file mode 100644 index 000000000..941edffbc --- /dev/null +++ b/ui/app/AppLayouts/Chat/ContactsColumn/EmptyView.qml @@ -0,0 +1,74 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 +import "../components" + +Item { + id: suggestionsContainer + Layout.fillHeight: true + Layout.fillWidth: true + + Row { + id: description + anchors.right: parent.right + anchors.rightMargin: 20 + anchors.left: parent.left + anchors.leftMargin: 20 + + Text { + width: parent.width + text: qsTr("Follow your interests in one of the many Public Chats.") + font.pointSize: 15 + wrapMode: Text.WordWrap + verticalAlignment: Text.AlignTop + horizontalAlignment: Text.AlignHCenter + fontSizeMode: Text.FixedSize + renderType: Text.QtRendering + onLinkActivated: console.log(link) + } + } + + RowLayout { + id: row + anchors.right: parent.right + anchors.rightMargin: 20 + anchors.left: parent.left + anchors.leftMargin: 20 + anchors.top: description.bottom + anchors.topMargin: 20 + + Flow { + Layout.fillHeight: false + 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" + } + } + } +} diff --git a/ui/app/AppLayouts/Chat/ContactsColumn/qmldir b/ui/app/AppLayouts/Chat/ContactsColumn/qmldir new file mode 100644 index 000000000..af782d982 --- /dev/null +++ b/ui/app/AppLayouts/Chat/ContactsColumn/qmldir @@ -0,0 +1 @@ +EmptyView 1.0 EmptyView.qml \ No newline at end of file