Revert "[apps/calculation/edit_expression_controller] Define viewWillAppear"

This reverts commit 960736203ff2f816688868e3397d178d931fa3c3.
This commit is contained in:
Ruben Dashyan
2019-10-15 16:31:26 +02:00
committed by Léa Saviot
parent 7f4dd1255a
commit 5787d50a45
3 changed files with 7 additions and 7 deletions

View File

@@ -52,6 +52,8 @@ void EditExpressionController::insertTextBody(const char * text) {
}
void EditExpressionController::didBecomeFirstResponder() {
int lastRow = m_calculationStore->numberOfCalculations() > 0 ? m_calculationStore->numberOfCalculations()-1 : 0;
m_historyController->scrollToCell(0, lastRow);
m_contentView.expressionField()->setEditing(true, false);
Container::activeApp()->setFirstResponder(m_contentView.expressionField());
}

View File

@@ -18,12 +18,6 @@ HistoryController::HistoryController(Responder * parentResponder, CalculationSto
}
}
void HistoryController::viewWillAppear() {
int rowsCount = numberOfRows();
int lastRow = (rowsCount > 0) * (rowsCount - 1);
selectCellAtLocation(0, lastRow);
}
void HistoryController::reload() {
m_selectableTableView.reloadData();
/* TODO
@@ -174,6 +168,10 @@ int HistoryController::typeAtLocation(int i, int j) {
return 0;
}
void HistoryController::scrollToCell(int i, int j) {
m_selectableTableView.scrollToCell(i, j);
}
HistoryViewCell * HistoryController::historyViewCellDidChangeSelection() {
/* Update the whole table as the height of the selected cell row might have
* changed. */

View File

@@ -14,7 +14,6 @@ class HistoryController : public ViewController, public ListViewDataSource, publ
public:
HistoryController(Responder * parentResponder, CalculationStore * calculationStore);
View * view() override { return &m_selectableTableView; }
void viewWillAppear() override;
bool handleEvent(Ion::Events::Event event) override;
void didBecomeFirstResponder() override;
void willExitResponderChain(Responder * nextFirstResponder) override;
@@ -26,6 +25,7 @@ public:
KDCoordinate rowHeight(int j) override;
int typeAtLocation(int i, int j) override;
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY, bool withinTemporarySelection = false) override;
void scrollToCell(int i, int j);
private:
int storeIndex(int i) { return numberOfRows() - i - 1; }
Shared::ExpiringPointer<Calculation> calculationAtIndex(int i);