mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/calculation] Move input memoization
Calculation's input is now only saved and restored when the app truly closes or opens, instead of whenever the EditExpressionController enters or leaves the responder chain (which also happens when the user switches to the history or the toolbox, or triggers a syntax error). Change-Id: I8404f1bc5619bcbc03272b406962d284fe25f7e2
This commit is contained in:
committed by
Émilie Feral
parent
d027d99597
commit
9e3470436a
@@ -56,14 +56,16 @@ void EditExpressionController::insertTextBody(const char * text) {
|
||||
void EditExpressionController::didBecomeFirstResponder() {
|
||||
m_contentView.mainView()->scrollToBottom();
|
||||
m_contentView.expressionField()->setEditing(true, false);
|
||||
m_contentView.expressionField()->restoreContent(m_cacheBuffer, *m_cacheBufferInformation);
|
||||
clearCacheBuffer();
|
||||
Container::activeApp()->setFirstResponder(m_contentView.expressionField());
|
||||
}
|
||||
|
||||
void EditExpressionController::willExitResponderChain(Responder * nextFirstResponder) {
|
||||
void EditExpressionController::restoreInput() {
|
||||
m_contentView.expressionField()->restoreContent(m_cacheBuffer, *m_cacheBufferInformation);
|
||||
clearCacheBuffer();
|
||||
}
|
||||
|
||||
void EditExpressionController::memoizeInput() {
|
||||
*m_cacheBufferInformation = m_contentView.expressionField()->moveCursorAndDumpContent(m_cacheBuffer, k_cacheBufferSize);
|
||||
::ViewController::willExitResponderChain(nextFirstResponder);
|
||||
}
|
||||
|
||||
void EditExpressionController::viewWillAppear() {
|
||||
|
||||
Reference in New Issue
Block a user