refactor: set_error take gui_state

insert into gui_state status when setting error
This commit is contained in:
Jack Wills
2023-08-26 12:40:53 +00:00
parent e49219752d
commit 62c78dfaa5
4 changed files with 14 additions and 18 deletions
+2 -4
View File
@@ -95,16 +95,14 @@ impl InputHandler {
} else {
self.app_data
.lock()
.set_error(AppError::MouseCapture(false));
self.gui_state.lock().status_push(Status::Error);
.set_error(AppError::MouseCapture(false), &self.gui_state, Status::Error);
}
} else if Ui::enable_mouse_capture().is_ok() {
self.gui_state
.lock()
.set_info_box("✓ mouse capture enabled".to_owned());
} else {
self.app_data.lock().set_error(AppError::MouseCapture(true));
self.gui_state.lock().status_push(Status::Error);
self.app_data.lock().set_error(AppError::MouseCapture(true), &self.gui_state, Status::Error);
};
// If the info box sleep handle is currently being executed, as in 'm' is pressed twice within a 4000ms window