mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-26 17:20:53 +01:00
[apps/calculation] EXE and OK have same behaviour on history controller
Change-Id: I4fed572db45e4604a1b44e5343f14b50db8cfcc6
This commit is contained in:
@@ -35,7 +35,7 @@ bool HistoryController::handleEvent(Ion::Events::Event event) {
|
||||
if (event == Ion::Events::Up) {
|
||||
return true;
|
||||
}
|
||||
if (event == Ion::Events::OK) {
|
||||
if (event == Ion::Events::OK || event == Ion::Events::EXE) {
|
||||
int focusRow = selectedRow();
|
||||
HistoryViewCell * selectedCell = (HistoryViewCell *)selectableTableView()->selectedCell();
|
||||
HistoryViewCell::SubviewType subviewType = selectedCell->selectedSubviewType();
|
||||
@@ -50,26 +50,6 @@ bool HistoryController::handleEvent(Ion::Events::Event event) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (event == Ion::Events::EXE) {
|
||||
int focusRow = selectedRow();
|
||||
HistoryViewCell * selectedCell = (HistoryViewCell *)selectableTableView()->selectedCell();
|
||||
HistoryViewCell::SubviewType subviewType = selectedCell->selectedSubviewType();
|
||||
EditExpressionController * editController = (EditExpressionController *)parentResponder();
|
||||
Calculation * calculation = m_calculationStore->calculationAtIndex(focusRow);
|
||||
const char * text;
|
||||
if (subviewType == HistoryViewCell::SubviewType::Input) {
|
||||
text = calculation->inputText();
|
||||
} else {
|
||||
text = calculation->outputText();
|
||||
}
|
||||
selectableTableView()->deselectTable();
|
||||
App * calculationApp = (App *)app();
|
||||
m_calculationStore->push(text, calculationApp->localContext());
|
||||
reload();
|
||||
selectableTableView()->scrollToCell(0, numberOfRows()-1);
|
||||
app()->setFirstResponder(editController);
|
||||
return true;
|
||||
}
|
||||
if (event == Ion::Events::Backspace) {
|
||||
int focusRow = selectedRow();
|
||||
HistoryViewCell * selectedCell = (HistoryViewCell *)selectableTableView()->selectedCell();
|
||||
|
||||
Reference in New Issue
Block a user