Lomiri
Loading...
Searching...
No Matches
GestureAreaSizeHint.qml
1/*
2 * Copyright (C) 2025 UBports Foundation
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.12
18import Lomiri.Components 1.3
19
20Rectangle {
21 id: root
22
23 function show() {
24 opacity = 0.3
25 timeoutTimer.restart()
26 }
27
28 enabled: false
29 opacity: 0
30 visible: opacity > 0
31 color: theme.palette.normal.activity
32
33 Behavior on opacity { LomiriNumberAnimation {} }
34
35 Timer {
36 id: timeoutTimer
37 interval: 2000
38 onTriggered: root.opacity = 0
39 }
40
41 Connections {
42 target: root.parent
43 enabled: root.enabled
44
45 // Avoid showing up when Lomiri starts
46 Component.onCompleted: root.enabled = true
47
48 onWidthChanged: root.show()
49 }
50}