[apps/shared][apps/graph][apps/sequence] Reorganise list controllers,

function title cells and function expression cells

Change-Id: Idbdae4975c8ed83a023c781dc14929b8c2053bb0
This commit is contained in:
Émilie Feral
2017-02-08 12:03:11 +01:00
parent e414f81d67
commit 0f4d7f0914
21 changed files with 306 additions and 136 deletions

View File

@@ -5,49 +5,16 @@ namespace Shared {
FunctionTitleCell::FunctionTitleCell(Orientation orientation, KDText::FontSize size) :
EvenOddCell(),
m_bufferTextView(size, 0.5f, 0.5f),
m_orientation(orientation)
{
}
void FunctionTitleCell::setHighlighted(bool highlight) {
EvenOddCell::setHighlighted(highlight);
m_bufferTextView.setHighlighted(highlight);
}
void FunctionTitleCell::setEven(bool even) {
EvenOddCell::setEven(even);
m_bufferTextView.setEven(even);
}
void FunctionTitleCell::setText(const char * title) {
m_bufferTextView.setText(title);
}
void FunctionTitleCell::setColor(KDColor color) {
m_functionColor = color;
m_bufferTextView.setTextColor(color);
}
int FunctionTitleCell::numberOfSubviews() const {
return 1;
}
View * FunctionTitleCell::subviewAtIndex(int index) {
assert(index == 0);
return &m_bufferTextView;
}
void FunctionTitleCell::layoutSubviews() {
KDRect textFrame(0, k_colorIndicatorThickness, bounds().width(), bounds().height() - k_colorIndicatorThickness);
if (m_orientation == Orientation::VerticalIndicator){
textFrame = KDRect(k_colorIndicatorThickness, 0, bounds().width() - k_colorIndicatorThickness, bounds().height());
}
m_bufferTextView.setFrame(textFrame);
reloadCell();
}
void FunctionTitleCell::drawRect(KDContext * ctx, KDRect rect) const {
EvenOddCell::drawRect(ctx, rect);
if (m_orientation == Orientation::VerticalIndicator){
ctx->fillRect(KDRect(0, 0, k_colorIndicatorThickness, bounds().height()), m_functionColor);
} else {