[escher] Implement ScrollView::minimalSizeForOptimalDisplay including margins

Remove from derived classes:
 - apps/calculation/scrollable_expression_view
 - apps/code/consol_line_cell
 - apps/shared/scrollable_exact_approximate_expressions_view
 - escher/layout_field
 - escher/table_view
 - escher/text_field
This commit is contained in:
Ruben Dashyan
2019-02-05 16:13:00 +01:00
committed by EmilieNumworks
parent 0e0b49acce
commit 08e8bf0eeb
15 changed files with 16 additions and 42 deletions

View File

@@ -16,7 +16,7 @@ ParametersController::ContentView::ContentView(Responder * parentResponder, Sele
}
void ParametersController::ContentView::drawRect(KDContext * ctx, KDRect rect) const {
int tableHeight = m_selectableTableView->minimalSizeForOptimalDisplay().height()+ Metric::CommonTopMargin + Metric::CommonBottomMargin;
int tableHeight = m_selectableTableView->minimalSizeForOptimalDisplay().height();
ctx->fillRect(KDRect(0, tableHeight, bounds().width(), bounds().height() - tableHeight), Palette::WallScreen);
}
@@ -53,7 +53,7 @@ View * ParametersController::ContentView::subviewAtIndex(int index) {
void ParametersController::ContentView::layoutSubviews() {
KDCoordinate titleHeight = KDFont::SmallFont->glyphSize().height()+k_titleMargin;
m_titleView.setFrame(KDRect(0, 0, bounds().width(), titleHeight));
KDCoordinate tableHeight = m_selectableTableView->minimalSizeForOptimalDisplay().height() + Metric::CommonTopMargin + Metric::CommonBottomMargin;
KDCoordinate tableHeight = m_selectableTableView->minimalSizeForOptimalDisplay().height();
m_selectableTableView->setFrame(KDRect(0, titleHeight, bounds().width(), tableHeight));
KDCoordinate textHeight = KDFont::SmallFont->glyphSize().height();
KDCoordinate defOrigin = (titleHeight+tableHeight)/2+(bounds().height()-textHeight)/2;