Visuals - Screen Management - Screen Timeout
Customize how long it takes for your screen to turn off.
This commit is contained in:
parent
14cd89f704
commit
fb11cc7ff4
@ -93,7 +93,7 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
|
||||
case QEvent::MouseMove: {
|
||||
// ignore events when device is awakened by resetInteractiveTimeout
|
||||
ignore = !device()->isAwake();
|
||||
device()->resetInteractiveTimeout();
|
||||
device()->resetInteractiveTimeout(uiState()->scene.screen_timeout;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -416,6 +416,7 @@ void ui_update_frogpilot_params(UIState *s) {
|
||||
scene.screen_brightness = screen_management ? params.getInt("ScreenBrightness") : 101;
|
||||
scene.screen_brightness_onroad = screen_management ? params.getInt("ScreenBrightnessOnroad") : 101;
|
||||
scene.screen_recorder = screen_management && params.getBool("ScreenRecorder");
|
||||
scene.screen_timeout = screen_management ? params.getInt("ScreenTimeout") : 30;
|
||||
|
||||
scene.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController");
|
||||
scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset");
|
||||
@ -537,6 +538,8 @@ void Device::setAwake(bool on) {
|
||||
void Device::resetInteractiveTimeout(int timeout) {
|
||||
if (timeout == -1) {
|
||||
timeout = (ignition_on ? 10 : 30);
|
||||
} else {
|
||||
timeout = timeout;
|
||||
}
|
||||
interactive_timeout = timeout * UI_FREQ;
|
||||
}
|
||||
@ -579,7 +582,7 @@ void Device::updateWakefulness(const UIState &s) {
|
||||
ignition_on = s.scene.ignition;
|
||||
|
||||
if (ignition_just_turned_off) {
|
||||
resetInteractiveTimeout();
|
||||
resetInteractiveTimeout(s.scene.screen_timeout);
|
||||
} else if (interactive_timeout > 0 && --interactive_timeout == 0) {
|
||||
emit interactiveTimeout();
|
||||
}
|
||||
|
@ -306,6 +306,7 @@ typedef struct UIScene {
|
||||
int obstacle_distance_stock;
|
||||
int screen_brightness;
|
||||
int screen_brightness_onroad;
|
||||
int screen_timeout;
|
||||
int steering_angle_deg;
|
||||
int stopped_equivalence;
|
||||
int wheel_icon;
|
||||
|
Loading…
x
Reference in New Issue
Block a user