Merge lp:~rpadovani/telegram-app/improveTextAreaDialogPage into lp:telegram-app/app-dev

Proposed by Riccardo Padovani
Status: Merged
Approved by: Michał Karnicki
Approved revision: 95
Merged at revision: 96
Proposed branch: lp:~rpadovani/telegram-app/improveTextAreaDialogPage
Merge into: lp:telegram-app/app-dev
Diff against target: 89 lines (+51/-14)
1 file modified
ui/DialogPage.qml (+51/-14)
To merge this branch: bzr merge lp:~rpadovani/telegram-app/improveTextAreaDialogPage
Reviewer Review Type Date Requested Status
Michał Karnicki (community) Approve
Nekhelesh Ramananthan (community) Needs Fixing
Review via email: mp+237175@code.launchpad.net

Commit message

Improved textfield in dialog page

Description of the change

Improved textfield in dialog page:
- Added button to send messages
- Substitued textfield with a textarea, as on Android
- Added a white rectangle as background

To post a comment you must log in.
Revision history for this message
Michał Karnicki (karni) wrote :

Some in-line comments.

review: Needs Fixing
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

When trying to run this MP, I get the following error,
telegram.qml:88 Type DialogPage unavailable
ui/DialogPage.qml:86 Cannot assign to non-existent property "background"

You need to change, 33 + background: "white" to color: "white.

review: Needs Fixing
Revision history for this message
Michał Karnicki (karni) wrote :

This will fix:
- bottom rect background
- closing the keyboard on each msg send
- the send button onClicked

=== modified file 'ui/DialogPage.qml'
--- ui/DialogPage.qml 2014-10-04 22:01:05 +0000
+++ ui/DialogPage.qml 2014-10-06 09:44:15 +0000
@@ -83,7 +83,7 @@
             }
             height: message.height + units.gu(2)

- background: "white"
+ color: "white"

             // Add button for emoji here

@@ -116,11 +116,13 @@
                 }

                 fillMode: Image.Pad
+ focus: false

                 enabled: message.text
                 source: enabled ? "../images/ic_send.png" : "../images/ic_send_disabled.png"

                 MouseArea {
+ anchors.fill: parent
                     onClicked: {
                         sendMessage(message.text);
                         list.positionViewAtBeginning();

Revision history for this message
Michał Karnicki (karni) wrote :

sorry for the nasty indentation, but I guess you'll figure what needs to be changed :)

95. By Riccardo Padovani

Fixed errors

Revision history for this message
Michał Karnicki (karni) wrote :

Well done!

review: Approve
96. By Riccardo Padovani

Merged from upstream

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'images/ic_send.png'
2Binary files images/ic_send.png 1970-01-01 00:00:00 +0000 and images/ic_send.png 2014-10-06 10:50:48 +0000 differ
3=== added file 'images/ic_send_disabled.png'
4Binary files images/ic_send_disabled.png 1970-01-01 00:00:00 +0000 and images/ic_send_disabled.png 2014-10-06 10:50:48 +0000 differ
5=== modified file 'ui/DialogPage.qml'
6--- ui/DialogPage.qml 2014-10-06 10:18:43 +0000
7+++ ui/DialogPage.qml 2014-10-06 10:50:48 +0000
8@@ -89,22 +89,59 @@
9 }
10 }
11
12- TextField {
13- id: message
14+ Rectangle {
15+ id: bottomRectangle
16 anchors {
17 left: parent.left
18+ right: parent.right
19 bottom: parent.bottom
20- right: parent.right
21-
22- margins: units.gu(1)
23- }
24- enabled: isConnected
25- placeholderText: i18n.tr("Type message")
26- inputMethodHints: Qt.ImhNone
27-
28- onAccepted: {
29- sendMessage(message.text);
30- list.positionViewAtBeginning();
31+ }
32+ height: message.height + units.gu(2)
33+
34+ color: "white"
35+
36+ // Add button for emoji here
37+
38+ TextArea {
39+ id: message
40+ anchors {
41+ left: parent.left
42+ right: sendButton.left
43+ bottom: parent.bottom
44+
45+ margins: units.gu(1)
46+ }
47+ enabled: isConnected
48+ placeholderText: i18n.tr("Type message")
49+ inputMethodHints: Qt.ImhNone
50+
51+ autoSize: true
52+ maximumLineCount: 4
53+ }
54+
55+ Image {
56+ id: sendButton
57+ anchors {
58+ right: parent.right
59+ top: parent.top
60+ bottom: parent.bottom
61+
62+ margins: units.gu(1.5)
63+ }
64+
65+ fillMode: Image.Pad
66+ focus: false
67+
68+ enabled: message.text
69+ source: enabled ? "../images/ic_send.png" : "../images/ic_send_disabled.png"
70+
71+ MouseArea {
72+ anchors.fill: parent
73+ onClicked: {
74+ sendMessage(message.text);
75+ list.positionViewAtBeginning();
76+ }
77+ }
78 }
79 }
80
81@@ -132,7 +169,7 @@
82 anchors {
83 top: parent.top
84 left: parent.left
85- bottom: message.top
86+ bottom: bottomRectangle.top
87 right: parent.right
88 }
89 header: Item {

Subscribers

People subscribed via source and target branches