Changeset View
Changeset View
Standalone View
Standalone View
applets/kimpanel/package/contents/ui/CandidateHighlight.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2017 Weng Xuetian <wengxt@gmail.com> | ||||
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; either version 2 of the License, or | ||||
7 | * (at your option) any later version. | ||||
8 | * | ||||
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. | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU General Public License | ||||
15 | * along with this program; if not, write to the Free Software | ||||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||||
17 | */ | ||||
18 | import QtQuick 2.1 | ||||
19 | import org.kde.plasma.core 2.0 as PlasmaCore | ||||
20 | | ||||
21 | Item { | ||||
22 | id: highlight | ||||
23 | | ||||
24 | property bool hover: false | ||||
25 | property bool selected: false | ||||
26 | property alias marginHints: background.margins; | ||||
27 | | ||||
28 | Behavior on opacity { | ||||
29 | NumberAnimation { | ||||
30 | duration: units.longDuration | ||||
31 | easing.type: Easing.OutQuad | ||||
32 | } | ||||
33 | } | ||||
34 | | ||||
35 | PlasmaCore.FrameSvgItem { | ||||
36 | id: background | ||||
37 | imagePath: "widgets/viewitem" | ||||
38 | prefix: { | ||||
39 | if (selected) | ||||
40 | return hover ? "selected+hover" : "selected"; | ||||
41 | | ||||
42 | if (hover) | ||||
43 | return "hover"; | ||||
44 | | ||||
45 | return "normal"; | ||||
46 | } | ||||
47 | | ||||
48 | anchors { | ||||
49 | fill: parent | ||||
50 | } | ||||
51 | } | ||||
52 | } |