Changeset View
Changeset View
Standalone View
Standalone View
applets/binary-clock/package/contents/ui/Square.qml
- This file was moved from applets/binary-clock/package/contents/ui/Dot.qml.
Show All 24 Lines | |||||
25 | import QtQuick 2.0 | 25 | import QtQuick 2.0 | ||
26 | 26 | | |||
27 | Item { | 27 | Item { | ||
28 | property int val | 28 | property int val | ||
29 | property int bit | 29 | property int bit | ||
30 | 30 | | |||
31 | /* both active and inactive squares */ | 31 | /* both active and inactive squares */ | ||
32 | Rectangle { | 32 | Rectangle { | ||
33 | width: main.dotSize | 33 | width: main.squareSize | ||
34 | height: width | 34 | height: width | ||
35 | color: (val & bit) ? main.onColor : main.offColor | 35 | color: (val & bit) ? main.onColor : main.offColor | ||
36 | x: 0 | 36 | x: 0 | ||
37 | y: 0 | 37 | y: 0 | ||
38 | visible: main.showOffLeds || color != main.offColor | 38 | visible: main.showOffLeds || color != main.offColor | ||
39 | } | 39 | } | ||
40 | 40 | | |||
41 | /* bottom border for each square */ | 41 | /* bottom border for each square */ | ||
42 | Rectangle { | 42 | Rectangle { | ||
43 | visible: main.showGrid | 43 | visible: main.showGrid | ||
44 | x: 0 | 44 | x: 0 | ||
45 | y: main.dotSize | 45 | y: main.squareSize | ||
46 | width: main.dotSize | 46 | width: main.squareSize | ||
47 | height: units.smallSpacing | 47 | height: units.smallSpacing | ||
48 | color: main.gridColor | 48 | color: main.gridColor | ||
49 | } | 49 | } | ||
50 | 50 | | |||
51 | /* right border for each square */ | 51 | /* right border for each square */ | ||
52 | Rectangle { | 52 | Rectangle { | ||
53 | visible: main.showGrid | 53 | visible: main.showGrid | ||
54 | x: main.dotSize | 54 | x: main.squareSize | ||
55 | y: 0 | 55 | y: 0 | ||
56 | width: units.smallSpacing | 56 | width: units.smallSpacing | ||
57 | height: main.dotSize+units.smallSpacing | 57 | height: main.squareSize+units.smallSpacing | ||
58 | color: main.gridColor | 58 | color: main.gridColor | ||
59 | } | 59 | } | ||
60 | } | 60 | } | ||
61 | No newline at end of file | 61 | No newline at end of file |