@@ -10,9 +10,9 @@ export component ArmButton inherits Rectangle {
10
10
callback clicked <=> ta.clicked;
11
11
in property <int > label ;
12
12
background : ta.pressed ? Palette.control-alternate-background.transparentize(0.5 ) : Palette.control-alternate-background;
13
- border-radius : 10px ;
14
- width : 130px ;
15
- height : 95px ;
13
+ border-radius : 5px ;
14
+ width : 65px ;
15
+ height : 47px ;
16
16
HaText {
17
17
font-size : root .label == -2 ? Style.H1 -font-size * 0.6 : Style.H2 -font-size;
18
18
text : root .label == -2 ? "⌫" : root .label;
@@ -37,6 +37,11 @@ export component Alarm inherits Control {
37
37
font-size : Style.H1 -font-size;
38
38
text : root .indirect-passcode;
39
39
opacity : 0 ;
40
+ changed width => {
41
+ if self .width > 130px {
42
+ root .passcode = -1 ;
43
+ }
44
+ }
40
45
}
41
46
42
47
content := Rectangle {
@@ -54,7 +59,7 @@ export component Alarm inherits Control {
54
59
color : Palette.hvac-knob-foreground;
55
60
font-weight : 300 ;
56
61
x : parent .width / 2 - self .width / 2 ;
57
- y : 100px ;
62
+ y : 50px ;
58
63
}
59
64
60
65
Rectangle {
@@ -77,20 +82,20 @@ export component Alarm inherits Control {
77
82
78
83
Rectangle {
79
84
width : 100% ;
80
- height : 50px ;
85
+ height : 25px ;
81
86
border-radius : self .height / 2 ;
82
87
background : Palette.alternate-background;
83
88
84
89
HaText {
85
90
text : "Arm Alarm" ;
86
91
color : Palette.foreground;
87
- font-size : 2rem ;
92
+ font-size : 1rem ;
88
93
}
89
94
}
90
95
}
91
96
92
97
Rectangle {
93
- width : 400px ;
98
+ width : 200px ;
94
99
states [
95
100
isVisible when root .full-screen: {
96
101
opacity : 1 ;
@@ -113,34 +118,30 @@ export component Alarm inherits Control {
113
118
]
114
119
x : parent .width / 2 - self .width / 2 ;
115
120
Rectangle {
116
- width : 130px * 3 + 2 * 10px ;
121
+ y : parent .height * 0.2 ;
122
+ width : 65px * 3 + 2 * 5px ;
117
123
height : (95px * 5 ) + (4 * 10px );
118
124
visible : root .full-screen;
119
125
120
126
container := Rectangle {
121
127
y : 0 ;
122
128
border-radius : 10px ;
123
129
width : 100% ;
124
- height : 95px ;
130
+ height : 48px ;
125
131
background : Palette.alternate-background;
126
132
le := LineEdit {
127
133
font-size : Style.H1 -font-size;
128
134
text : root .indirect-passcode;
129
135
input-type : password;
130
- width : Math.max(290px , hidden-text.width);
131
- changed width => {
132
- if self .width > 300px {
133
- root .passcode = -1 ;
134
- }
135
- }
136
+ width : 145px ;
136
137
}
137
138
138
139
mask := Rectangle {
139
- width : le.width + (17px * 2 );
140
+ width : le.width + (9px * 2 );
140
141
height : container.height - 1px ;
141
- x : le.x - 17px ;
142
+ x : le.x - 9px ;
142
143
y : container.y + 1px ;
143
- border-width : 18px ;
144
+ border-width : 9px ;
144
145
border-color : Palette.lineedit-background;
145
146
}
146
147
@@ -149,7 +150,7 @@ export component Alarm inherits Control {
149
150
height : container.height;
150
151
x : container.x;
151
152
y : container.y;
152
- border-radius : 10px ;
153
+ border-radius : 5px ;
153
154
background : Palette.lineedit-background;
154
155
}
155
156
@@ -158,7 +159,7 @@ export component Alarm inherits Control {
158
159
height : container.height;
159
160
x : mask.x + mask.width;
160
161
y : container.y;
161
- border-radius : 10px ;
162
+ border-radius : 5px ;
162
163
background : Palette.lineedit-background;
163
164
}
164
165
}
@@ -171,12 +172,12 @@ export component Alarm inherits Control {
171
172
[7 , 8 , 9 ],
172
173
[-1 , 0 , -2 ],
173
174
]: Rectangle {
174
- y : (r * 105px ) + 105px ;
175
+ y : (r * 52px ) + 52px ;
175
176
width : 100% ;
176
- height : 170px ;
177
+ height : 85px ;
177
178
178
179
HorizontalLayout {
179
- spacing : 10px ;
180
+ spacing : 5px ;
180
181
for num [c ] in row-model: ArmButton {
181
182
label : num;
182
183
clicked => {
@@ -198,11 +199,11 @@ export component Alarm inherits Control {
198
199
x : 0 ;
199
200
VerticalLayout {
200
201
alignment : end;
201
- spacing : 5px ;
202
- padding : 5px ;
202
+ spacing : 2px ;
203
+ padding : 2px ;
203
204
204
205
controls := Rectangle {
205
- border-radius : 20px ;
206
+ border-radius : 10px ;
206
207
width : 95% ;
207
208
height : self .preferred-height;
208
209
background : Palette.music-gradient.transparentize(0.2 );
@@ -212,8 +213,8 @@ export component Alarm inherits Control {
212
213
}
213
214
HorizontalLayout {
214
215
alignment : space-around;
215
- padding-top : 15px ;
216
- padding-bottom : 15px ;
216
+ padding-top : 8px ;
217
+ padding-bottom : 8px ;
217
218
}
218
219
}
219
220
}
@@ -227,10 +228,10 @@ export component Alarm inherits Control {
227
228
}
228
229
source : @image-url ("../images/reduce.svg" ) ;
229
230
colorize : white;
230
- x : root .width - self .width - 30px ;
231
- y : 30px ;
232
- width : 60px ;
233
- height : 60px ;
231
+ x : root .width - self .width - self .y ;
232
+ y : 15px ;
233
+ width : 30px ;
234
+ height : 30px ;
234
235
TouchArea {
235
236
enabled : closeButton.opacity > 0.1 ;
236
237
clicked => {
0 commit comments