mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 15:50:49 +01:00
[apps/code][python] ConsoleController doesn't keep any pointer/boolean to know
if the sandbox/matplotlib view controller is displayed. Its state won't be always right; instead, use the StackViewController depth. This fixes the following bug: when popping the sandbox/matplotlib view controller, the first responder token was not given to the console controller!
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
#include "sandbox_controller.h"
|
||||
#include <apps/apps_container.h>
|
||||
|
||||
extern "C" {
|
||||
#include <python/port/mod/turtle/modturtle.h>
|
||||
}
|
||||
|
||||
namespace Code {
|
||||
|
||||
SandboxController::SandboxController(Responder * parentResponder, MicroPython::ExecutionEnvironment * executionEnvironment) :
|
||||
SandboxController::SandboxController(Responder * parentResponder) :
|
||||
ViewController(parentResponder),
|
||||
ExecutionViewControllerHelper(executionEnvironment),
|
||||
m_solidColorView(KDColorWhite)
|
||||
{
|
||||
assert(executionEnvironment != nullptr);
|
||||
}
|
||||
|
||||
StackViewController * SandboxController::stackViewController() {
|
||||
@@ -21,10 +23,13 @@ void SandboxController::reset() {
|
||||
}
|
||||
|
||||
void SandboxController::viewWillAppear() {
|
||||
ExecutionViewControllerHelper::viewWillAppear(this);
|
||||
redrawWindow();
|
||||
}
|
||||
|
||||
void SandboxController::viewDidDisappear() {
|
||||
modturtle_view_did_disappear();
|
||||
}
|
||||
|
||||
bool SandboxController::handleEvent(Ion::Events::Event event) {
|
||||
// The sandbox handles or "absorbs" all keyboard events except Home and OnOff
|
||||
if (event == Ion::Events::Home || event == Ion::Events::OnOff) {
|
||||
|
||||
Reference in New Issue
Block a user