panes: the API example gives the document focus on to_document

This commit is contained in:
aiongg committed 2026-10-19 13:30:02 +00:00
1 parent 4325b9ccc1
commit 9359332fd7
1 file changed
+7 -1
+7 -1
View File
@@ -42,7 +42,13 @@ for request in out.requests {
PaneRequest::Focus(_) => {}
}
}
egui::CentralPanel::default().show(ui, |ui| document(ui));
egui::CentralPanel::default().show(ui, |ui| {
let response = document(ui);
if out.to_document {
// F6 or Shift+F6 left the panes: the document takes keyboard focus.
response.request_focus();
}
});
```
| Piece | Behaviour |