[apps/calculation] Fix error: scroll when copying a history line

Change-Id: I6120c22afd63abe6ac5bf4e264ad7fcc712fe291
This commit is contained in:
Émilie Feral
2017-03-24 10:20:39 +01:00
parent 784fe53679
commit 85b27c372d
2 changed files with 5 additions and 5 deletions

View File

@@ -39,14 +39,14 @@ bool HistoryController::handleEvent(Ion::Events::Event event) {
HistoryViewCell * selectedCell = (HistoryViewCell *)m_selectableTableView.cellAtLocation(0, focusRow);
HistoryViewCell::SubviewType subviewType = selectedCell->selectedSubviewType();
EditExpressionController * editController = (EditExpressionController *)parentResponder();
m_selectableTableView.deselectTable();
app()->setFirstResponder(editController);
Calculation * calculation = m_calculationStore->calculationAtIndex(focusRow);
if (subviewType == HistoryViewCell::SubviewType::Input) {
editController->setTextBody(calculation->inputText());
} else {
editController->setTextBody(calculation->outputText());
}
m_selectableTableView.deselectTable();
app()->setFirstResponder(editController);
return true;
}
if (event == Ion::Events::EXE) {

View File

@@ -73,7 +73,6 @@ void TextField::ContentView::setText(const char * text) {
if (m_isEditing) {
strlcpy(m_draftTextBuffer, text, m_textBufferSize);
m_currentTextLength = strlen(text);
setCursorLocation(m_currentTextLength);
} else {
strlcpy(m_textBuffer, text, m_textBufferSize);
}
@@ -224,8 +223,9 @@ int TextField::cursorLocation() const{
void TextField::setText(const char * text) {
reloadScroll();
m_contentView.setText(text);
scrollToCursor();
layoutSubviews();
if (isEditing()) {
setCursorLocation(textLength());
}
}
void TextField::setBackgroundColor(KDColor backgroundColor) {