blob: 610e28af1e5d45cc9656eea99a7435ddfd411fab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
import QtQuick 2.15
import Style 1.0
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import com.nextcloud.desktopclient 1.0
Item {
id: root
function sendReplyMessage() {
if (replyMessageTextField.text === "") {
return;
}
UserModel.currentUser.sendReplyMessage(model.index, model.conversationToken, replyMessageTextField.text, model.messageId);
}
Text {
id: replyMessageSent
text: model.messageSent
font.pixelSize: Style.topLinePixelSize
color: Style.menuBorder
visible: model.messageSent !== ""
}
TextField {
id: replyMessageTextField
// TODO use Layout to manage width/height. The Layout.minimunWidth does not apply to the width set.
height: 38
width: 250
onAccepted: root.sendReplyMessage()
visible: replyMessageSent.text === ""
topPadding: 4
placeholderText: qsTr("Reply to …")
background: Rectangle {
id: replyMessageTextFieldBorder
radius: 24
border.width: 1
border.color: Style.ncBlue
color: Style.backgroundColor
}
Button {
id: sendReplyMessageButton
width: 32
height: parent.height
opacity: 0.8
flat: true
enabled: replyMessageTextField.text !== ""
onClicked: root.sendReplyMessage()
icon {
source: "image://svgimage-custom-color/send.svg" + "/" + Style.ncBlue
width: 38
height: 38
color: hovered || !sendReplyMessageButton.enabled? Style.menuBorder : Style.ncBlue
}
anchors {
right: replyMessageTextField.right
top: replyMessageTextField.top
}
ToolTip {
visible: sendReplyMessageButton.hovered
delay: Qt.styleHints.mousePressAndHoldInterval
text: qsTr("Send reply to chat message")
}
}
}
}
|