mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-26 01:00:50 +01:00
[code] Fixed the wait for user input after drawing using Python.
A SandboxController is now pushed on the StackViewController and sets the KDIonContext::sharedContext before drawing, sets a white background and handles user input after the Python computation to dismiss the drawing screen. Change-Id: I51b0474365a85e845227379a16d090541fa8ded7
This commit is contained in:
31
apps/code/sandbox_controller.cpp
Normal file
31
apps/code/sandbox_controller.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "sandbox_controller.h"
|
||||
#include <apps/apps_container.h>
|
||||
|
||||
namespace Code {
|
||||
|
||||
SandboxController::SandboxController(Responder * parentResponder) :
|
||||
ViewController(parentResponder),
|
||||
m_solidColorView(KDColorWhite)
|
||||
{
|
||||
}
|
||||
|
||||
StackViewController * SandboxController::stackViewController() {
|
||||
return static_cast<StackViewController *>(parentResponder());
|
||||
}
|
||||
|
||||
void SandboxController::viewWillAppear() {
|
||||
static_cast<AppsContainer *>(const_cast<Container *>(app()->container()))->redrawWindow();
|
||||
}
|
||||
|
||||
bool SandboxController::handleEvent(Ion::Events::Event event) {
|
||||
if (event == Ion::Events::Home || event == Ion::Events::OnOff) {
|
||||
stackViewController()->pop();
|
||||
return false;
|
||||
}
|
||||
if (event == Ion::Events::OK || event == Ion::Events::Back) {
|
||||
stackViewController()->pop();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user