on e507710 help sign in
60 lines 1.8 kB history raw
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Olivier Tilloy <olivier.tilloy@canonical.com>
19 */
21import QtQuick 2.0
22import Ubuntu.Components 0.1
24Item {
25 property alias action: __sendButton.action
26 property alias text: __replyField.text
27 property alias buttonText: __sendButton.text
29 TextField {
30 id: __replyField
32 anchors.top: parent.top
33 anchors.bottom: parent.bottom
34 anchors.left: parent.left
35 anchors.right: __sendButton.left
36 anchors.rightMargin: units.gu(1)
37 placeholderText: "Reply"
38 hasClearButton: false
40 onEnabledChanged: {
41 //Make sure that the component lost focus when enabled = false,
42 //otherwise it will get focus again when enable = true
43 if (!enabled) {
44 focus = false;
45 }
46 }
47 }
49 ActionButton {
50 id: __sendButton
52 actionParameter: __replyField.text
53 anchors.top: parent.top
54 anchors.bottom: parent.bottom
55 anchors.right: parent.right
56 width: units.gu(9)
57 enabled: __replyField.text !== ""
58 color: enabled ? "#c94212" : "#bababa"
59 }