[apps/reg] Calculation column size depends on regression type

This commit is contained in:
Léa Saviot
2018-06-13 15:55:48 +02:00
committed by Émilie Feral
parent 42982cb078
commit 428b60771b
2 changed files with 14 additions and 3 deletions

View File

@@ -230,7 +230,17 @@ void CalculationController::willDisplayCellAtLocation(HighlightCell * cell, int
}
KDCoordinate CalculationController::columnWidth(int i) {
return i == 0 ? k_calculationTitleCellWidth : k_calculationCellWidth;
if (i == 0) {
return k_smallCalculationCellWidth;
}
Model::Type currentType = m_store->seriesRegressionType(m_store->indexOfKthNonEmptySeries(i-1));
if (currentType == Model::Type::Quartic) {
return k_quarticCalculationCellWidth;
}
if (currentType == Model::Type::Cubic) {
return k_cubicCalculationCellWidth;
}
return k_smallCalculationCellWidth;
}
KDCoordinate CalculationController::rowHeight(int j) {

View File

@@ -64,8 +64,9 @@ private:
static constexpr int k_regressionCellIndex = 9;
static constexpr KDCoordinate k_cellHeight = 25;
static constexpr KDCoordinate k_calculationTitleCellWidth = Ion::Display::Width/2 - Metric::CommonRightMargin/2 - Metric::CommonLeftMargin/2;
static constexpr KDCoordinate k_calculationCellWidth = 195;
static constexpr KDCoordinate k_smallCalculationCellWidth = Ion::Display::Width/2 - Metric::CommonRightMargin/2 - Metric::CommonLeftMargin/2;
static constexpr KDCoordinate k_cubicCalculationCellWidth = 150;
static constexpr KDCoordinate k_quarticCalculationCellWidth = 195;
static constexpr KDCoordinate k_margin = 8;
static constexpr KDCoordinate k_r2CellMargin = 2;
static constexpr KDCoordinate k_scrollBarMargin = Metric::CommonRightMargin;