Files
Upsilon/escher/src/expression_table_cell_with_expression.cpp
Hugo Saint-Vignes e27c668c40 [apps,escher,kandinsky,poincare,python] Replace every "grey" with "gray"
Change-Id: I60a232849dce90f70e6977b6024d6e9b1ce1b731
2020-11-04 15:07:20 +01:00

29 lines
1.1 KiB
C++

#include <escher/expression_table_cell_with_expression.h>
#include <escher/container.h>
#include <escher/palette.h>
#include <assert.h>
ExpressionTableCellWithExpression::ExpressionTableCellWithExpression(Responder * parentResponder) :
ExpressionTableCell(parentResponder, Layout::HorizontalLeftOverlap),
m_accessoryExpressionView(this, k_horizontalMargin, 0, 1.0f, 0.5f, Palette::GrayDark, KDColorWhite)
{}
View * ExpressionTableCellWithExpression::accessoryView() const {
return (View *)&m_accessoryExpressionView;
}
void ExpressionTableCellWithExpression::setHighlighted(bool highlight) {
ExpressionTableCell::setHighlighted(highlight);
KDColor backgroundColor = highlight? Palette::Select : KDColorWhite;
m_accessoryExpressionView.setBackgroundColor(backgroundColor);
}
void ExpressionTableCellWithExpression::setAccessoryLayout(Poincare::Layout l) {
m_accessoryExpressionView.setLayout(l);
layoutSubviews();
}
void ExpressionTableCellWithExpression::didBecomeFirstResponder() {
Container::activeApp()->setFirstResponder(&m_accessoryExpressionView);
}