Files
Upsilon/apps/shared/new_function_cell.cpp
Émilie Feral 35b979798d [escher] Optimize redrawing when changing features in cells (color,
highlight, even)

Change-Id: I0afa8b6fad656d578bb8e071183646196bc816f9
2017-11-21 17:37:25 +01:00

36 lines
761 B
C++

#include "new_function_cell.h"
#include "assert.h"
namespace Shared {
NewFunctionCell::NewFunctionCell(I18n::Message text) :
EvenOddCell(),
m_messageTextView(KDText::FontSize::Large, text, 0.5f, 0.5f)
{
}
void NewFunctionCell::setEven(bool even) {
EvenOddCell::setEven(even);
m_messageTextView.setBackgroundColor(backgroundColor());
}
void NewFunctionCell::setHighlighted(bool highlight) {
EvenOddCell::setHighlighted(highlight);
m_messageTextView.setBackgroundColor(backgroundColor());
}
int NewFunctionCell::numberOfSubviews() const {
return 1;
}
View * NewFunctionCell::subviewAtIndex(int index) {
assert(index == 0);
return &m_messageTextView;
}
void NewFunctionCell::layoutSubviews() {
m_messageTextView.setFrame(bounds());
}
}