2 * Copyright (C) 2021 Capsia
3 * Copyright (C) 2016 Canonical, Ltd.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 3.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19import Lomiri.Components 1.3
24 objectName: "promptButton"
26 property alias text: buttonLabel.text
27 property alias interactive: root.enabled
28 property bool isSecret
29 property bool loginError: false
30 property bool hasKeyboard: false
31 property string enteredText: ""
35 signal accepted(string response)
37 Keys.onSpacePressed: clicked();
38 Keys.onReturnPressed: clicked();
39 Keys.onEnterPressed: clicked();
43 activeFocusOnTab: true
49 Behavior on border.color {
53 color: root.loginError ? theme.palette.normal.negative : theme.palette.normal.raisedSecondaryText
54 width: root.loginError ? units.dp(2): units.dp(1)
60 onClicked: parent.clicked();
65 anchors.centerIn: parent
66 color: theme.palette.normal.raisedSecondaryText