[escher] TextField: call reinitDraftBuffer after edition is complete to

avoid erasing text that is required later.

Fix bug: OK handling on function list in linear mode did not copy the
function expression into the textfield before editing
This commit is contained in:
Émilie Feral
2019-07-30 11:27:42 +02:00
committed by LeaNumworks
parent 7b84b65502
commit 7a4ee746b2
11 changed files with 40 additions and 43 deletions

View File

@@ -49,7 +49,7 @@ void MenuController::willExitResponderChain(Responder * nextFirstResponder) {
if (selectedRow >= 0 && selectedRow < m_scriptStore->numberOfScripts() && selectedColumn == 0) {
TextField * tf = static_cast<ScriptNameCell *>(m_selectableTableView.selectedCell())->textField();
if (tf->isEditing()) {
tf->setEditing(false, false);
tf->setEditing(false);
privateTextFieldDidAbortEditing(tf, false);
}
}
@@ -126,7 +126,7 @@ void MenuController::renameSelectedScript() {
ScriptNameCell * myCell = static_cast<ScriptNameCell *>(m_selectableTableView.selectedCell());
Container::activeApp()->setFirstResponder(myCell);
myCell->setHighlighted(false);
myCell->textField()->setEditing(true, false);
myCell->textField()->setEditing(true);
myCell->textField()->setCursorLocation(myCell->textField()->text() + strlen(myCell->textField()->text()));
}