mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/calculation] When EditExpressionController becomes the first
responder, scroll to the bottom of the table (and not the last cell). Indeed, the last cell might be to big to be displayed and scroll to it might scroll to its top. This fixes the following bug: input 1/2/3/4/5/6/7/8, OK, up, down. We did not scroll to the bottom of the table.
This commit is contained in:
@@ -9,7 +9,7 @@ using namespace Poincare;
|
||||
|
||||
namespace Calculation {
|
||||
|
||||
EditExpressionController::ContentView::ContentView(Responder * parentResponder, TableView * subview, InputEventHandlerDelegate * inputEventHandlerDelegate, TextFieldDelegate * textFieldDelegate, LayoutFieldDelegate * layoutFieldDelegate) :
|
||||
EditExpressionController::ContentView::ContentView(Responder * parentResponder, CalculationSelectableTableView * subview, InputEventHandlerDelegate * inputEventHandlerDelegate, TextFieldDelegate * textFieldDelegate, LayoutFieldDelegate * layoutFieldDelegate) :
|
||||
View(),
|
||||
m_mainView(subview),
|
||||
m_expressionField(parentResponder, inputEventHandlerDelegate, textFieldDelegate, layoutFieldDelegate)
|
||||
@@ -42,7 +42,7 @@ EditExpressionController::EditExpressionController(Responder * parentResponder,
|
||||
ViewController(parentResponder),
|
||||
m_historyController(historyController),
|
||||
m_calculationStore(calculationStore),
|
||||
m_contentView(this, (TableView *)m_historyController->view(), inputEventHandlerDelegate, this, this)
|
||||
m_contentView(this, static_cast<CalculationSelectableTableView *>(m_historyController->view()), inputEventHandlerDelegate, this, this)
|
||||
{
|
||||
m_cacheBuffer[0] = 0;
|
||||
}
|
||||
@@ -53,8 +53,7 @@ void EditExpressionController::insertTextBody(const char * text) {
|
||||
}
|
||||
|
||||
void EditExpressionController::didBecomeFirstResponder() {
|
||||
int lastRow = m_calculationStore->numberOfCalculations() > 0 ? m_calculationStore->numberOfCalculations()-1 : 0;
|
||||
m_contentView.mainView()->scrollToCell(0, lastRow);
|
||||
m_contentView.mainView()->scrollToBottom();
|
||||
m_contentView.expressionField()->setEditing(true, false);
|
||||
Container::activeApp()->setFirstResponder(m_contentView.expressionField());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user