10 m_expressionView(1.0f, 0.5f),
11 m_displayExpression(
false)
19 int VariableBoxLeafCell::numberOfSubviews()
const {
20 if (m_displayExpression) {
26 View * VariableBoxLeafCell::subviewAtIndex(
int index) {
31 return &m_subtitleView;
33 assert(numberOfSubviews() == 3 && index == 2);
34 return &m_expressionView;
37 void VariableBoxLeafCell::layoutSubviews() {
40 if (numberOfSubviews() == 3) {
43 m_labelView.
setFrame(
KDRect(k_separatorThickness+k_widthMargin, k_separatorThickness, labelSize.
width(), height/2 - k_separatorThickness));
44 m_subtitleView.
setFrame(
KDRect(k_separatorThickness+k_widthMargin, height/2, subtitleSize.
width(), height/2-k_separatorThickness));
47 KDCoordinate expressionAvailableSize = width-k_separatorThickness-3*k_widthMargin-maxTextSize;
48 m_expressionView.
setFrame(
KDRect(width - expressionAvailableSize - k_widthMargin, k_separatorThickness, expressionAvailableSize, height-2*k_separatorThickness));
56 m_labelView.
setFrame(
KDRect(k_separatorThickness+k_widthMargin, k_separatorThickness, width/2-k_separatorThickness-k_widthMargin, height-2*k_separatorThickness));
57 m_subtitleView.
setFrame(
KDRect(width/2, 1, width/2-k_separatorThickness-k_widthMargin, height-2*k_separatorThickness));
87 ctx->
fillRect(
KDRect(k_separatorThickness, k_separatorThickness, width-2*k_separatorThickness, height-2*k_separatorThickness), backgroundColor);
void setBackgroundColor(KDColor backgroundColor)
void setText(const char *text) override
void setFrame(KDRect frame)
constexpr KDCoordinate width() const
void setExpression(Poincare::ExpressionLayout *expressionLayout)
void setLabel(const char *text)
KDSize minimalSizeForOptimalDisplay() const override
void setAlignment(float horizontalAlignment, float verticalAlignment)
constexpr KDColor KDColorWhite
void setExpressionLayout(Poincare::ExpressionLayout *expressionLayout)
static constexpr KDColor Select
void displayExpression(bool displayExpression)
constexpr KDColor KDColorBlack
bool isHighlighted() const
void reloadCell() override
void fillRect(KDRect rect, KDColor color)
void drawRect(KDContext *ctx, KDRect rect) const override
void setAlignment(float horizontalAlignment, float verticalAlignment)
KDCoordinate width() const
void setSubtitle(const char *text)
virtual void reloadCell()
void setBackgroundColor(KDColor backgroundColor)
static constexpr KDColor GreyBright
KDCoordinate height() const
KDSize minimalSizeForOptimalDisplay() const override