mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 06:10:31 +01:00
Add margin right of "un=" Align the text vertically so that the equal is vertically centered in the cell. This makes the left and right cell baselines be approximately at the same level for basic sequences definition (un = 1, un=1/2, ...)
35 lines
999 B
C++
35 lines
999 B
C++
#ifndef SEQUENCE_SEQUENCE_TITLE_CELL_H
|
|
#define SEQUENCE_SEQUENCE_TITLE_CELL_H
|
|
|
|
#include "../shared/function_title_cell.h"
|
|
#include <poincare_layouts.h>
|
|
|
|
namespace Sequence {
|
|
|
|
class SequenceTitleCell : public Shared::FunctionTitleCell {
|
|
public:
|
|
SequenceTitleCell();
|
|
void setLayout(Poincare::Layout layout);
|
|
void setEven(bool even) override;
|
|
void setHighlighted(bool highlight) override;
|
|
void setColor(KDColor color) override;
|
|
void setOrientation(Orientation orientation) override;
|
|
const KDFont * font() const override {
|
|
return Poincare::CharLayoutNode::k_defaultFont;
|
|
}
|
|
Poincare::Layout layout() const override {
|
|
return m_titleTextView.layout();
|
|
}
|
|
private:
|
|
static constexpr float k_horizontalOrientationAlignment = 0.5f;
|
|
static constexpr float k_verticalOrientationHorizontalAlignment = 0.9f;
|
|
int numberOfSubviews() const override;
|
|
View * subviewAtIndex(int index) override;
|
|
void layoutSubviews() override;
|
|
EvenOddExpressionCell m_titleTextView;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|