2 * Copyright (C) 2016 Canonical Ltd.
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.
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.
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/>.
18import QtGraphicalEffects 1.12
19import Lomiri.Components 1.3
24 // This property holds the delay (milliseconds) after which the tool tip is shown.
25 // A tooltip with a negative delay is shown immediately. The default value is 500 ms.
26 property int delay: 500
28 // This property holds the text shown on the tool tip.
29 property alias text: label.text
31 readonly property bool lightMode: true
33 aspect: LomiriShape.Flat
34 color: theme.palette.normal.background
35 width: label.implicitWidth + units.gu(4)
36 height: label.implicitHeight + units.gu(2)
43 rightMargin: -units.dp(4)
44 verticalCenter: parent.verticalCenter
46 source: "graphics/quicklist_tooltip.png"
48 visible: !root.lightMode
55 rotation: arrow.rotation
56 visible: root.lightMode
61 anchors.centerIn: parent
62 color: theme.palette.normal.backgroundText
78 from: ""; to: "visible"
80 PauseAnimation { duration: root.delay }
81 LomiriNumberAnimation { target: root; property: "opacity"; duration: LomiriAnimation.BriskDuration }