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