[poincare] Change names: LayoutReference-->Layout

This commit is contained in:
Émilie Feral
2018-09-18 16:28:39 +02:00
parent f5298650a7
commit 365b145cf3
277 changed files with 1654 additions and 1671 deletions

View File

@@ -66,9 +66,9 @@ SolutionsController::SolutionsController(Responder * parentResponder, EquationSt
m_delta2Layout(),
m_contentView(this)
{
m_delta2Layout = HorizontalLayoutReference(VerticalOffsetLayoutReference(CharLayoutReference('2', KDText::FontSize::Small), VerticalOffsetLayoutNode::Type::Superscript), LayoutHelper::String("-4ac", 4, KDText::FontSize::Small));
m_delta2Layout = HorizontalLayout(VerticalOffsetLayout(CharLayout('2', KDText::FontSize::Small), VerticalOffsetLayoutNode::Type::Superscript), LayoutHelper::String("-4ac", 4, KDText::FontSize::Small));
char deltaB[] = {Ion::Charset::CapitalDelta, '=', 'b'};
static_cast<HorizontalLayoutReference&>(m_delta2Layout).addOrMergeChildAtIndex(LayoutHelper::String(deltaB, 3, KDText::FontSize::Small), 0, false);
static_cast<HorizontalLayout&>(m_delta2Layout).addOrMergeChildAtIndex(LayoutHelper::String(deltaB, 3, KDText::FontSize::Small), 0, false);
for (int i = 0; i < EquationStore::k_maxNumberOfExactSolutions; i++) {
m_exactValueCells[i].setParentResponder(m_contentView.selectableTableView());
}
@@ -145,7 +145,7 @@ void SolutionsController::willDisplayCellAtLocation(HighlightCell * cell, int i,
if (i == 0) {
if (m_equationStore->type() == EquationStore::Type::PolynomialMonovariable && j == m_equationStore->numberOfSolutions()) {
EvenOddExpressionCell * deltaCell = static_cast<EvenOddExpressionCell *>(cell);
deltaCell->setLayoutReference(m_delta2Layout);
deltaCell->setLayout(m_delta2Layout);
} else {
EvenOddBufferTextCell * symbolCell = static_cast<EvenOddBufferTextCell *>(cell);
symbolCell->setFontSize(KDText::FontSize::Large);
@@ -171,7 +171,7 @@ void SolutionsController::willDisplayCellAtLocation(HighlightCell * cell, int i,
valueCell->setText(bufferValue);
} else {
Shared::ScrollableExactApproximateExpressionsCell * valueCell = static_cast<ScrollableExactApproximateExpressionsCell *>(cell);
Poincare::LayoutReference exactLayout = m_equationStore->exactSolutionLayoutsAtIndexAreIdentical(j) ? Poincare::LayoutReference() : m_equationStore->exactSolutionLayoutAtIndex(j, true);
Poincare::Layout exactLayout = m_equationStore->exactSolutionLayoutsAtIndexAreIdentical(j) ? Poincare::Layout() : m_equationStore->exactSolutionLayoutAtIndex(j, true);
valueCell->setLayouts(m_equationStore->exactSolutionLayoutAtIndex(j, false), exactLayout);
if (!exactLayout.isUninitialized()) {
valueCell->setEqualMessage(m_equationStore->exactSolutionLayoutsAtIndexAreEqual(j) ? I18n::Message::Equal : I18n::Message::AlmostEqual);
@@ -194,8 +194,8 @@ KDCoordinate SolutionsController::rowHeight(int j) {
if (m_equationStore->type() == EquationStore::Type::Monovariable) {
return k_defaultCellHeight;
}
Poincare::LayoutReference exactLayout = m_equationStore->exactSolutionLayoutAtIndex(j, true);
Poincare::LayoutReference approximateLayout = m_equationStore->exactSolutionLayoutAtIndex(j, false);
Poincare::Layout exactLayout = m_equationStore->exactSolutionLayoutAtIndex(j, true);
Poincare::Layout approximateLayout = m_equationStore->exactSolutionLayoutAtIndex(j, false);
KDCoordinate exactLayoutHeight = exactLayout.layoutSize().height();
KDCoordinate approximateLayoutHeight = approximateLayout.layoutSize().height();
KDCoordinate layoutHeight = max(exactLayout.baseline(), approximateLayout.baseline()) + max(exactLayoutHeight-exactLayout.baseline(), approximateLayoutHeight-approximateLayout.baseline());