File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ struct Active {
119
119
widgets : WidgetContainer ,
120
120
locator : Arc < Topic < bool > > ,
121
121
alerts : Arc < Topic < AlertList > > ,
122
+ brightness : Arc < Topic < f32 > > ,
122
123
}
123
124
124
125
impl ActivatableScreen for ScreenSaverScreen {
@@ -159,11 +160,16 @@ impl ActivatableScreen for ScreenSaverScreen {
159
160
160
161
let locator = ui. locator . clone ( ) ;
161
162
let alerts = ui. alerts . clone ( ) ;
163
+ let brightness = ui. res . backlight . brightness . clone ( ) ;
164
+
165
+ // Dim to 10% brightness in screensaver mode
166
+ brightness. set ( 0.1 ) ;
162
167
163
168
let active = Active {
164
169
widgets,
165
170
locator,
166
171
alerts,
172
+ brightness,
167
173
} ;
168
174
169
175
Box :: new ( active)
@@ -177,6 +183,8 @@ impl ActiveScreen for Active {
177
183
}
178
184
179
185
async fn deactivate ( mut self : Box < Self > ) -> Display {
186
+ // Restore full backlight brightness
187
+ self . brightness . set ( 1.0 ) ;
180
188
self . widgets . destroy ( ) . await
181
189
}
182
190
You can’t perform that action at this time.
0 commit comments