desktop: prompt to power off on back button long press (#1279)
* desktop: prompt to power off on back button long press Implemented by launching Power Settings app, passing "off" as arg to directly jump to "power off" scene.
This commit is contained in:
5
applications/power/power_settings_app/scenes/power_settings_scene_power_off.c
Executable file → Normal file
5
applications/power/power_settings_app/scenes/power_settings_scene_power_off.c
Executable file → Normal file
@@ -28,7 +28,10 @@ bool power_settings_scene_power_off_on_event(void* context, SceneManagerEvent ev
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == DialogExResultLeft) {
|
||||
scene_manager_previous_scene(app->scene_manager);
|
||||
if(!scene_manager_previous_scene(app->scene_manager)) {
|
||||
scene_manager_stop(app->scene_manager);
|
||||
view_dispatcher_stop(app->view_dispatcher);
|
||||
}
|
||||
} else if(event.event == DialogExResultRight) {
|
||||
power_off(app->power);
|
||||
}
|
||||
|
Reference in New Issue
Block a user