Merge lp:~phablet-team/messaging-app/select-part-of-message into lp:messaging-app/staging

Proposed by Renato Araujo Oliveira Filho
Status: Needs review
Proposed branch: lp:~phablet-team/messaging-app/select-part-of-message
Merge into: lp:messaging-app/staging
Prerequisite: lp:~phablet-team/messaging-app/improve-participants-screen
Diff against target: 92 lines (+20/-5)
3 files modified
debian/control (+1/-0)
src/qml/RegularMessageDelegate_irc.qml (+7/-5)
src/qml/messaging-app.qml (+12/-0)
To merge this branch: bzr merge lp:~phablet-team/messaging-app/select-part-of-message
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+317116@code.launchpad.net

Commit message

Allow user to select part of the message when mouse is present.

To post a comment you must log in.

Unmerged revisions

649. By Renato Araujo Oliveira Filho

Allow to select part of the message when mouse is present.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2017-02-13 15:44:59 +0000
3+++ debian/control 2017-02-13 15:45:00 +0000
4@@ -55,6 +55,7 @@
5 qtdeclarative5-qtcontacts-plugin,
6 qtdeclarative5-gsettings1.0,
7 qml-module-qt-labs-settings,
8+ qml-module-qtsysteminfo,
9 ttf-ancient-fonts-symbola,
10 Recommends: unity8 (>= 7.81.0~),
11 Description: messaging application for Ubuntu
12
13=== modified file 'src/qml/RegularMessageDelegate_irc.qml'
14--- src/qml/RegularMessageDelegate_irc.qml 2017-02-13 15:44:59 +0000
15+++ src/qml/RegularMessageDelegate_irc.qml 2017-02-13 15:45:00 +0000
16@@ -76,7 +76,7 @@
17 divider.visible: false
18 contentItem.clip: false
19
20- Label {
21+ TextEdit {
22 id: label
23
24 function parseText(text) {
25@@ -86,8 +86,6 @@
26
27 // remove html tags
28 text = text.replace(/</g,'&lt;').replace(/>/g,'<tt>&gt;</tt>');
29- // wrap text in a div to keep whitespaces and new lines from collapsing
30- text = '<div style="white-space: pre-wrap;">' + text + '</div>';
31 // check for links
32 var htmlText = BaLinkify.linkify(text);
33 if (htmlText !== text) {
34@@ -133,17 +131,21 @@
35 right: parent.right
36 margins: units.gu(1)
37 }
38- text: "%1 <font color=\"%2\">[%3]</font>\t%4"
39+ text: "%1 <font color=\"%2\">[%3]</font> %4"
40 .arg(Qt.formatTime(messageData.timestamp, Qt.DefaultLocaleShortDate))
41 .arg(incoming ? "green" : "blue")
42 .arg(sender)
43 .arg(parseText(messageDelegate.messageText))
44
45+
46 wrapMode: Text.WordWrap
47-
48 onLinkActivated: Qt.openUrlExternally(link)
49+ readOnly: true
50+ selectByMouse: mainView.mouseAttached
51+ textFormat: TextEdit.RichText
52 }
53
54+ swipeEnabled: !mainView.mouseAttached
55 leadingActions: ListItemActions {
56 actions: [
57 Action {
58
59=== modified file 'src/qml/messaging-app.qml'
60--- src/qml/messaging-app.qml 2017-02-13 15:44:59 +0000
61+++ src/qml/messaging-app.qml 2017-02-13 15:45:00 +0000
62@@ -19,6 +19,7 @@
63 import QtQuick 2.2
64 import QtQuick.Window 2.2
65 import Qt.labs.settings 1.0
66+import QtSystemInfo 5.5
67 import Ubuntu.Components 1.3
68 import Ubuntu.Components.Popups 1.3
69 import Ubuntu.Telephony 0.1
70@@ -36,6 +37,7 @@
71 property bool dualPanel: mainStack.columns > 1
72 property bool composingNewMessage: activeMessagesView && activeMessagesView.newMessage
73 property QtObject activeMessagesView: null
74+ readonly property bool mouseAttached: (miceModel.count + touchPadModel.count) > 0
75 // settings
76 property alias sortTrheadsBy: globalSettings.sortTrheadsBy
77 property alias compactView: globalSettings.compactView
78@@ -497,4 +499,14 @@
79 layout.completed = true;
80 }
81 }
82+
83+ InputDeviceModel {
84+ id: touchPadModel
85+ filter: InputInfo.TouchPad
86+ }
87+
88+ InputDeviceModel {
89+ id: miceModel
90+ filter: InputInfo.Mouse
91+ }
92 }

Subscribers

People subscribed via source and target branches

to all changes: