[apps/graph/graph] initialize the graph view context when the graph controller is

the first responder

Change-Id: I12c7b2c28e750cd49ef59de59c659a349dd0a346
This commit is contained in:
Émilie Feral
2016-11-29 16:21:42 +01:00
parent 9c677a8483
commit 56240d61bb

View File

@@ -33,10 +33,6 @@ GraphController::GraphController(Responder * parentResponder, FunctionStore * fu
}
View * GraphController::view() {
if (m_view.context() == nullptr) {
App * graphApp = (Graph::App *)app();
m_view.setContext(graphApp->evaluateContext());
}
return &m_view;
}
@@ -101,6 +97,10 @@ Button * GraphController::buttonAtIndex(int index) {
}
void GraphController::didBecomeFirstResponder() {
if (m_view.context() == nullptr) {
App * graphApp = (Graph::App *)app();
m_view.setContext(graphApp->evaluateContext());
}
if (m_axisInterval.context() == nullptr) {
App * graphApp = (Graph::App *)app();
m_axisInterval.setContext(graphApp->evaluateContext());