Merge lp:~cellsoftware/telegram-app/1592266 into lp:telegram-app

Proposed by Ash
Status: Merged
Approved by: Jin
Approved revision: 218
Merged at revision: 220
Proposed branch: lp:~cellsoftware/telegram-app/1592266
Merge into: lp:telegram-app
Diff against target: 196 lines (+92/-82)
1 file modified
telegram/app/qml/AccountDialogPage.qml (+92/-82)
To merge this branch: bzr merge lp:~cellsoftware/telegram-app/1592266
Reviewer Review Type Date Requested Status
Jin (community) Approve
Review via email: mp+300064@code.launchpad.net

Description of the change

There was a 'Connection' component missing from the 'AccountDialogPage' and just basically adds a function that navigates the user back and shows the 'Select Chat' option.

To post a comment you must log in.
Revision history for this message
Jin (jindallo) wrote :

The code looks good and verified pass locally,
I approve.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'telegram/app/qml/AccountDialogPage.qml'
--- telegram/app/qml/AccountDialogPage.qml 2016-06-17 13:55:02 +0000
+++ telegram/app/qml/AccountDialogPage.qml 2016-07-14 12:47:51 +0000
@@ -1,4 +1,5 @@
1import QtQuick 2.41import QtQuick 2.4
2import Ubuntu.Content 1.3
2import Ubuntu.Components 1.33import Ubuntu.Components 1.3
3import Ubuntu.Components.ListItems 1.3 as ListItem4import Ubuntu.Components.ListItems 1.3 as ListItem
4import QtQuick.Window 2.25import QtQuick.Window 2.2
@@ -80,88 +81,85 @@
80 objectName: "dialogPage"81 objectName: "dialogPage"
8182
82 header: PageHeader {83 header: PageHeader {
83 id: dialog_page_header84 id: dialog_page_header
84 trailingActionBar.actions: message_list.inSelectionMode ? selectionActions : defaultActions85 trailingActionBar.actions: message_list.inSelectionMode ? selectionActions : defaultActions
85 leadingActionBar.actions: Action {86 leadingActionBar.actions: Action {
86 id: back_action87 id: back_action
87 iconName: message_list.inSelectionMode ? "close" : "back"88 iconName: message_list.inSelectionMode ? "close" : "back"
88 onTriggered: {89 onTriggered: {
89 if (message_list.inSelectionMode) {90 if (message_list.inSelectionMode) {
90 message_list.cancelSelection()91 message_list.cancelSelection()
91 } else {92 } else {
92 if(mainView.width > units.gu(80)) {93 backToChatList();
93 dialogDidGoBack = true;94 }
94 }95 }
95 pageStack.removePages(dialog_page);96 }
96 }97 flickable: null
97 }98
98 }99 //Adds components to the header
99 flickable: null100 contents: Rectangle {
100101 anchors {
101 //Adds components to the header102 top: parent.top
102 contents: Rectangle {103 topMargin: units.dp(8)
103 anchors {104 left: parent.left
104 top: parent.top105 verticalCenter: parent
105 topMargin: units.dp(8)106 right: parent.right
106 left: parent.left107 rightMargin: units.gu(5)
107 verticalCenter: parent108 bottom: parent.bottom
108 right: parent.right109 }
109 rightMargin: units.gu(5)110
110 bottom: parent.bottom111 //Text adjusts to the parent
111 }112 Text {
112113 anchors {
113 //Text adjusts to the parent114 top: parent.top
114 Text {115 topMargin: units.gu(0.2)
115 anchors {116 left: imgAvatar.right
116 top: parent.top117 leftMargin: units.gu(1)
117 topMargin: units.gu(0.2)118 }
118 left: imgAvatar.right119 width: parent.width
119 leftMargin: units.gu(1)120
120 }121 text: {
121 width: parent.width122 if (!currentDialog) return "";
122123 if (isChat) {
123 text: {124 return chat ? chat.title : ""; //Shown if a group chat
124 if (!currentDialog) return "";125 } else {
125 if (isChat) {126 return user ? user.firstName + " " + user.lastName : ""; //Shown if a scret chat
126 return chat ? chat.title : ""; //Shown if a group chat127 }
127 } else {128 }
128 return user ? user.firstName + " " + user.lastName : ""; //Shown if a scret chat129 font.pixelSize: FontUtils.sizeToPixels("large")
129 }130 //Word wraps text when text is too long for width
130 }131 wrapMode: Text.WordWrap
131 font.pixelSize: FontUtils.sizeToPixels("large")132 //Enables the elipse to the end of the text
132 //Word wraps text when text is too long for width133 elide: Text.ElideRight
133 wrapMode: Text.WordWrap134 //Wraps text to 1 line
134 //Enables the elipse to the end of the text135 maximumLineCount: 1
135 elide: Text.ElideRight136 }
136 //Wraps text to 1 line137
137 maximumLineCount: 1138 //Avatar component gets avatar for user as specified from 'dialog' parameter
138 }139 Avatar {
139140 id: imgAvatar
140 //Avatar component gets avatar for user as specified from 'dialog' parameter141
141 Avatar {142 width: height
142 id: imgAvatar143 telegram: dialog_page.telegramObject
143144 dialog: dialog_page.currentDialog
144 width: height145 }
145 telegram: dialog_page.telegramObject146
146 dialog: dialog_page.currentDialog147 //'Lock' image that is overlayed ontop of the Avatar conponent
147 }148 Image {
148149 anchors {
149 //'Lock' image that is overlayed ontop of the Avatar conponent150 left: imgAvatar.right
150 Image {151 leftMargin: -width-5
151 anchors {152 top: imgAvatar.top
152 left: imgAvatar.right153 topMargin: units.dp(2)
153 leftMargin: -width-5154 }
154 top: imgAvatar.top155 width: units.gu(1)
155 topMargin: units.dp(2)156 height: units.gu(1.5)
156 }157 source: "qrc:/qml/files/lock.png"
157 width: units.gu(1)158 sourceSize: Qt.size(width, height)
158 height: units.gu(1.5)159 visible: currentDialog.encrypted
159 source: "qrc:/qml/files/lock.png"160 }
160 sourceSize: Qt.size(width, height)161 }
161 visible: currentDialog.encrypted162 }
162 }
163 }
164 }
165163
166 signal forwardRequest(var messageIds);164 signal forwardRequest(var messageIds);
167 signal tagSearchRequest(string tag);165 signal tagSearchRequest(string tag);
@@ -176,6 +174,18 @@
176 });174 });
177 }175 }
178176
177 function backToChatList() {
178 if(mainView.width > units.gu(80)) {
179 dialogDidGoBack = true;
180 }
181 pageStack.removePages(dialog_page);
182 }
183
184 Connections {
185 target: ContentHub
186 onShareRequested: backToChatList()
187 }
188
179 Component.onCompleted: {189 Component.onCompleted: {
180 // This is needed to have the username list ready for @ completion190 // This is needed to have the username list ready for @ completion
181 // CuteGram upstream calls this implicitly because of the items in the top bar.191 // CuteGram upstream calls this implicitly because of the items in the top bar.

Subscribers

People subscribed via source and target branches

to status/vote changes: