Changeset View
Changeset View
Standalone View
Standalone View
applets/systemloadviewer/package/contents/ui/ColorPicker.qml
- This file was deleted.
1 | /* | | |||
---|---|---|---|---|---|
2 | * Copyright (C) 2014 Martin Yrjölä <martin.yrjola@gmail.com> | | |||
3 | * | | |||
4 | * This program is free software; you can redistribute it and/or | | |||
5 | * modify it under the terms of the GNU General Public License as | | |||
6 | * published by the Free Software Foundation; either version 2 of | | |||
7 | * the License or (at your option) version 3 or any later version | | |||
8 | * accepted by the membership of KDE e.V. (or its successor approved | | |||
9 | * by the membership of KDE e.V.), which shall act as a proxy | | |||
10 | * defined in Section 14 of version 3 of the license. | | |||
11 | * | | |||
12 | * This program is distributed in the hope that it will be useful, | | |||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | | |||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | |||
15 | * GNU General Public License for more details. | | |||
16 | * | | |||
17 | * You should have received a copy of the GNU General Public License | | |||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/> | | |||
19 | */ | | |||
20 | | ||||
21 | import QtQuick 2.2 | | |||
22 | import QtQuick.Layouts 1.0 | | |||
23 | import QtQuick.Controls 1.2 as QtControls | | |||
24 | import QtQuick.Dialogs 1.0 as QtDialogs | | |||
25 | import org.kde.plasma.core 2.0 as PlasmaCore | | |||
26 | | ||||
27 | Item { | | |||
28 | id: colorPicker | | |||
29 | | ||||
30 | property alias chosenColor: colorDialog.color | | |||
31 | | ||||
32 | width: childrenRect.width | | |||
33 | height: childrenRect.height | | |||
34 | Layout.alignment: Qt.AlignVCenter | | |||
35 | | ||||
36 | Rectangle { | | |||
37 | color: colorDialog.color | | |||
38 | radius: width / 2 | | |||
39 | height: 20 | | |||
40 | width: height | | |||
41 | opacity: enabled ? 1 : 0.5 | | |||
42 | border { | | |||
43 | width: mouseArea.containsMouse ? 3 : 1 | | |||
44 | color: Qt.darker(colorDialog.color, 1.5) | | |||
45 | } | | |||
46 | | ||||
47 | QtDialogs.ColorDialog { | | |||
48 | id: colorDialog | | |||
49 | } | | |||
50 | } | | |||
51 | | ||||
52 | MouseArea { | | |||
53 | id: mouseArea | | |||
54 | anchors.fill: parent | | |||
55 | hoverEnabled: true | | |||
56 | onClicked: { | | |||
57 | colorDialog.open() | | |||
58 | } | | |||
59 | } | | |||
60 | } | |