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

Proposed by Riccardo Padovani
Status: Merged
Approved by: Michał Karnicki
Approved revision: 137
Merged at revision: 140
Proposed branch: lp:~rpadovani/telegram-app/sendByEnter
Merge into: lp:telegram-app/app-dev
Diff against target: 77 lines (+37/-2)
3 files modified
telegram.qml (+7/-0)
ui/DialogPage.qml (+10/-2)
ui/SettingsPage.qml (+20/-0)
To merge this branch: bzr merge lp:~rpadovani/telegram-app/sendByEnter
Reviewer Review Type Date Requested Status
Michał Karnicki (community) Approve
Review via email: mp+239244@code.launchpad.net

Commit message

Added option to send messages using enter button

Description of the change

Added option to send messages using enter button

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

Minor style in-line comments. Other than that, very nice!

review: Needs Fixing
137. By Riccardo Padovani

Code style improvements

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Done

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'telegram.qml'
2--- telegram.qml 2014-10-21 14:03:09 +0000
3+++ telegram.qml 2014-10-23 12:28:41 +0000
4@@ -227,6 +227,13 @@
5 property bool promptForPush: true
6 }
7
8+ Settings {
9+ id: preferencesSettings
10+ category: "preferences"
11+
12+ property bool sendByEnter: false
13+ }
14+
15 Loader {
16 id: pushClientLoader
17 active: false
18
19=== modified file 'ui/DialogPage.qml'
20--- ui/DialogPage.qml 2014-10-17 13:11:56 +0000
21+++ ui/DialogPage.qml 2014-10-23 12:28:41 +0000
22@@ -104,8 +104,6 @@
23
24 color: "white"
25
26- // Add button for emoji here
27-
28 TextArea {
29 id: message
30 anchors {
31@@ -124,6 +122,16 @@
32
33 autoSize: true
34 maximumLineCount: 4
35+ Keys.onReturnPressed: {
36+ if (preferencesSettings.sendByEnter && isConnected) {
37+ Qt.inputMethod.commit();
38+ if (message.text.length === 0) return;
39+
40+ sendMessage(message.text);
41+ } else {
42+ event.accepted = false;
43+ }
44+ }
45 }
46
47 Item {
48
49=== modified file 'ui/SettingsPage.qml'
50--- ui/SettingsPage.qml 2014-10-15 17:42:46 +0000
51+++ ui/SettingsPage.qml 2014-10-23 12:28:41 +0000
52@@ -71,6 +71,26 @@
53 }
54
55 ListItem.Header {
56+ text: i18n.tr("Messages")
57+ }
58+
59+ ListItem.Standard {
60+ text: i18n.tr("Send by Enter")
61+
62+ Switch {
63+ id: checkbox
64+ checked: preferencesSettings.sendByEnter
65+ anchors {
66+ right: parent.right
67+ rightMargin: units.gu(2)
68+ verticalCenter: parent.verticalCenter
69+ }
70+
71+ onCheckedChanged: preferencesSettings.sendByEnter = checked;
72+ }
73+ }
74+
75+ ListItem.Header {
76 text: i18n.tr("Support")
77 }
78

Subscribers

People subscribed via source and target branches