mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/calculation] Fix HistoryController: update the OutputView when
reloading the table data
This commit is contained in:
@@ -26,6 +26,8 @@ void HistoryController::reload() {
|
||||
*/
|
||||
if (numberOfRows() > 0) {
|
||||
m_selectableTableView.scrollToCell(0, numberOfRows()-1);
|
||||
// Force to reload last added cell (hide the burger and exact output if necessary)
|
||||
tableViewDidChangeSelection(&m_selectableTableView, 0, numberOfRows()-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,6 +137,8 @@ void HistoryController::tableViewDidChangeSelection(SelectableTableView * t, int
|
||||
setSelectedSubviewType(SubviewType::Output, previousSelectedCellX, previousSelectedCellY);
|
||||
} else if (selectedRow() > previousSelectedCellY) {
|
||||
setSelectedSubviewType(SubviewType::Input, previousSelectedCellX, previousSelectedCellY);
|
||||
} else if (selectedRow() == -1) {
|
||||
setSelectedSubviewType(SubviewType::Input, previousSelectedCellX, previousSelectedCellY);
|
||||
}
|
||||
HistoryViewCell * selectedCell = (HistoryViewCell *)(t->selectedCell());
|
||||
if (selectedCell == nullptr) {
|
||||
|
||||
@@ -165,7 +165,6 @@ void HistoryViewCell::setCalculation(Calculation * calculation) {
|
||||
Poincare::Layout leftOutputLayout = calculation->createExactOutputLayout();
|
||||
Poincare::Layout rightOutputLayout = (m_calculationDisplayOutput == Calculation::DisplayOutput::ExactOnly) ? leftOutputLayout :
|
||||
calculation->createApproximateOutputLayout(context);
|
||||
m_scrollableOutputView.setDisplayLeftLayout(m_calculationDisplayOutput == Calculation::DisplayOutput::ExactAndApproximate); // Must be before the setLayouts fo the reload
|
||||
m_scrollableOutputView.setLayouts(rightOutputLayout, leftOutputLayout);
|
||||
I18n::Message equalMessage = calculation->exactAndApproximateDisplayedOutputsAreEqual(context) == Calculation::EqualSign::Equal ? I18n::Message::Equal : I18n::Message::AlmostEqual;
|
||||
m_scrollableOutputView.setEqualMessage(equalMessage);
|
||||
|
||||
Reference in New Issue
Block a user