on fcbade5 help sign in
66 lines 1.9 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 actionGroup: sendButton.actionGroup
26 property alias action: sendButton.action
28 property alias text: replyField.text
29 property alias buttonText: sendButton.text
31 TextField {
32 id: replyField
34 anchors {
35 top: parent.top
36 bottom: parent.bottom
37 left: parent.left
38 right: sendButton.left
39 rightMargin: units.gu(1)
40 }
41 placeholderText: "Reply"
42 hasClearButton: false
44 onEnabledChanged: {
45 //Make sure that the component lost focus when enabled = false,
46 //otherwise it will get focus again when enable = true
47 if (!enabled) {
48 focus = false;
49 }
50 }
51 }
53 ActionButton {
54 id: sendButton
56 actionParameter: replyField.text
57 anchors {
58 top: parent.top
59 bottom: parent.bottom
60 right: parent.right
61 }
62 width: units.gu(9)
63 enabled: replyField.text !== ""
64 color: enabled ? "#c94212" : "#bababa"
65 }