[apps/calculation] Reinitiate the scrolling when reloading the pretty

print view

Change-Id: I1975e46cc63109d47223018ca0e09bdc40274573
This commit is contained in:
Émilie Feral
2016-10-27 10:24:50 +02:00
parent a219316535
commit c9434ab5a2
3 changed files with 6 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ void HistoryViewCell::reloadCell() {
m_result.setBackgroundColor(Palette::CellBackgroundColor);
m_prettyPrint.setBackgroundColor(backgroundColor);
}
m_prettyPrint.reloadCell();
TableViewCell::reloadCell();
layoutSubviews();
}

View File

@@ -34,6 +34,10 @@ KDSize PrettyPrintView::minimalSizeForOptimalDisplay() {
return m_expressionView.minimalSizeForOptimalDisplay();
}
void PrettyPrintView::reloadCell() {
setContentOffset({0, 0});
}
bool PrettyPrintView::handleEvent(Ion::Events::Event event) {
switch (event) {
case Ion::Events::Event::RIGHT_ARROW:

View File

@@ -13,6 +13,7 @@ public:
void setBackgroundColor(KDColor backgroundColor);
bool handleEvent(Ion::Events::Event event) override;
KDSize minimalSizeForOptimalDisplay() override;
void reloadCell();
private:
ExpressionView m_expressionView;
KDCoordinate m_manualScrolling;