[escher] Add a class even odd pointer text cell

Change-Id: I843ad6626fff17306ab288e532eba6273a034573
This commit is contained in:
Émilie Feral
2016-12-19 12:13:57 +01:00
parent 3cc4ebf83f
commit de4ae4a3a8
4 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#include <escher/even_odd_pointer_text_cell.h>
#include <assert.h>
EvenOddPointerTextCell::EvenOddPointerTextCell() :
EvenOddCell(),
m_pointerTextView(nullptr, 0.5f, 0.5f)
{
}
void EvenOddPointerTextCell::reloadCell() {
EvenOddCell::reloadCell();
m_pointerTextView.setBackgroundColor(backgroundColor());
}
void EvenOddPointerTextCell::setText(const char * title, KDColor textColor) {
m_pointerTextView.setText(title);
m_pointerTextView.setTextColor(textColor);
}
int EvenOddPointerTextCell::numberOfSubviews() const {
return 1;
}
View * EvenOddPointerTextCell::subviewAtIndex(int index) {
assert(index == 0);
return &m_pointerTextView;
}
void EvenOddPointerTextCell::layoutSubviews() {
m_pointerTextView.setFrame(bounds());
}