[apps/calculation] EditExpressionController accesses subview directly

This commit is contained in:
Ruben Dashyan
2020-03-11 15:24:36 +01:00
committed by Émilie Feral
parent 63ab8710b9
commit 167827f0e4
3 changed files with 1 additions and 6 deletions

View File

@@ -54,7 +54,7 @@ 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.mainView()->scrollToCell(0, lastRow);
m_contentView.expressionField()->setEditing(true, false);
Container::activeApp()->setFirstResponder(m_contentView.expressionField());
}

View File

@@ -223,10 +223,6 @@ int HistoryController::typeAtLocation(int i, int j) {
return 0;
}
void HistoryController::scrollToCell(int i, int j) {
m_selectableTableView.scrollToCell(i, j);
}
bool HistoryController::calculationAtIndexToggles(int index) {
Context * context = App::app()->localContext();
return index >= 0 && index < m_calculationStore->numberOfCalculations() && calculationAtIndex(index)->displayOutput(context) == Calculation::DisplayOutput::ExactAndApproximateToggle;

View File

@@ -31,7 +31,6 @@ 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);