mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/calculation/edit_expression_controller] Define viewWillAppear
This commit is contained in:
committed by
Léa Saviot
parent
b624e47ccb
commit
b832a9e9f4
@@ -53,8 +53,6 @@ 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());
|
||||
}
|
||||
|
||||
@@ -18,6 +18,12 @@ 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
|
||||
@@ -168,10 +174,6 @@ 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. */
|
||||
|
||||
@@ -14,6 +14,7 @@ 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;
|
||||
@@ -25,7 +26,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);
|
||||
|
||||
Reference in New Issue
Block a user