[apps/shared] StoreController: compute cell width from the number of

glyph required to display the largest float
This commit is contained in:
Émilie Feral
2019-09-25 17:40:04 +02:00
committed by LeaNumworks
parent 4d593a6149
commit e7e4820513

View File

@@ -45,8 +45,7 @@ public:
void didBecomeFirstResponder() override;
protected:
static constexpr KDCoordinate k_cellWidth = 116;
static_assert((Poincare::PrintFloat::glyphLengthForFloatWithPrecision(Poincare::Preferences::LargeNumberOfSignificantDigits)) * 7 + 2*Metric::CellMargin < k_cellWidth, "Store controller cells are too small to hold values like '-1.234567E-123'"); // KDFont::SmallFont->glyphSize().width() = 7
static constexpr KDCoordinate k_cellWidth = Poincare::PrintFloat::glyphLengthForFloatWithPrecision(Poincare::Preferences::LargeNumberOfSignificantDigits) * 7 + 2*Metric::CellMargin + Metric::TableSeparatorThickness; // KDFont::SmallFont->glyphSize().width() = 7
constexpr static int k_maxNumberOfEditableCells = (Ion::Display::Width/k_cellWidth+2) * ((Ion::Display::Height - Metric::TitleBarHeight - Metric::TabHeight)/k_cellHeight+2);
constexpr static int k_numberOfTitleCells = 4;