Changeset View
Changeset View
Standalone View
Standalone View
applets/binary-clock/package/contents/ui/Dot.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Rewrite of the KDE4-Plasma Binary Clock for KF5/Plasma/QML | ||||
3 | * | ||||
4 | * Copyright 2014 Joseph Wenninger <jowenn@kde.org> | ||||
5 | * | ||||
6 | * Original code (KDE4): | ||||
7 | * Copyright 2007 by Riccardo Iaconelli <riccardo@kde.org> * | ||||
8 | * Copyright 2007 by Davide Bettio <davide.bettio@kdemail.net> | ||||
9 | * | ||||
10 | * This program is free software; you can redistribute it and/or | ||||
11 | * modify it under the terms of the GNU General Public License as | ||||
12 | * published by the Free Software Foundation; either version 2 of | ||||
13 | * the License, or (at your option) any later version. | ||||
14 | * | ||||
15 | * This program is distributed in the hope that it will be useful, | ||||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
18 | * GNU General Public License for more details. | ||||
19 | * | ||||
20 | * You should have received a copy of the GNU General Public License | ||||
21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
22 | */ | ||||
23 | | ||||
24 | import QtQuick 2.0 | ||||
25 | | ||||
26 | Item { | ||||
27 | property int val | ||||
28 | property int bit | ||||
29 | | ||||
30 | Rectangle { | ||||
31 | width: main.dotSize | ||||
32 | height: width | ||||
33 | color: (val & bit) ? main.onColor:main.offColor | ||||
34 | x:0 | ||||
35 | y:0 | ||||
36 | visible:main.showOffLeds || color!=main.offColor | ||||
37 | } | ||||
38 | Rectangle { | ||||
39 | visible:main.showGrid | ||||
40 | x:0 | ||||
41 | y:main.dotSize | ||||
42 | width:main.dotSize | ||||
43 | height:units.smallSpacing | ||||
44 | color:main.gridColor; | ||||
45 | } | ||||
46 | Rectangle { | ||||
47 | visible:main.showGrid | ||||
48 | x:main.dotSize | ||||
49 | y:0 | ||||
50 | width:units.smallSpacing | ||||
51 | height:main.dotSize+units.smallSpacing | ||||
52 | color:main.gridColor | ||||
53 | } | ||||
54 | } | ||||
55 | No newline at end of file |