mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/code] ConsoleController: when becoming first responder, check if a
controller is displayed and switch the first responder accordingly
This commit is contained in:
@@ -190,7 +190,16 @@ void ConsoleController::viewWillAppear() {
|
||||
}
|
||||
|
||||
void ConsoleController::didBecomeFirstResponder() {
|
||||
Container::activeApp()->setFirstResponder(&m_editCell);
|
||||
if (viewControllerIsDisplayed(nullptr)) {
|
||||
Container::activeApp()->setFirstResponder(&m_editCell);
|
||||
} else {
|
||||
/* A view controller might be displayed: for example, when pushing the
|
||||
* console on the stack controller, we auto-import scripts during the
|
||||
* 'viewWillAppear' and then we set the console as first responder. The
|
||||
* sandbox or the matplotlib controller might have been pushed in the
|
||||
* auto-import. */
|
||||
Container::activeApp()->setFirstResponder(m_displayedViewController);
|
||||
}
|
||||
}
|
||||
|
||||
bool ConsoleController::handleEvent(Ion::Events::Event event) {
|
||||
|
||||
Reference in New Issue
Block a user