Lomiri
Loading...
Searching...
No Matches
MouseTouchEmulationCheckbox.qml
1/*
2 * Copyright (C) 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU 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 General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.15
18import QtQml 2.15
19import QtQuick.Layouts 1.1
20import Lomiri.Components 1.3
21import Lomiri.SelfTest 0.1
22
23RowLayout {
24 id: root
25 property alias color: label.color
26 property alias checked: checkbox.checked
27
28 Binding {
29 target: MouseTouchAdaptor
30 restoreMode: Binding.RestoreBinding
31 property: "enabled"
32 value: checkbox.checked
33 }
34
35 Layout.fillWidth: true
36 CheckBox {
37 id: checkbox
38 checked: true
39 activeFocusOnPress: false
40 }
41 Label {
42 Layout.alignment: Qt.AlignVCenter
43 id: label
44 text: "Mouse emulates touch"
45 AbstractButton {
46 anchors.fill: parent
47 onClicked: checkbox.checked = !checkbox.checked
48 }
49 }
50}