Files
Upsilon/apps/graph/values/title_cell.cpp
Émilie Feral 5a6ffa412b [apps/graph/values] Add a class function title cell inheriting from
title cell

Change-Id: I2c88477a1508a102c7d469f35bef4a811cbc93b7
2016-10-18 09:50:21 +02:00

36 lines
660 B
C++

#include "title_cell.h"
#include <assert.h>
namespace Graph {
TitleCell::TitleCell() :
EvenOddCell(),
m_pointerTextView(nullptr, 0.5f, 0.5f)
{
}
void TitleCell::reloadCell() {
EvenOddCell::reloadCell();
m_pointerTextView.setBackgroundColor(backgroundColor());
}
void TitleCell::setText(const char * title, KDColor textColor) {
m_pointerTextView.setText(title);
m_pointerTextView.setTextColor(textColor);
}
int TitleCell::numberOfSubviews() const {
return 1;
}
View * TitleCell::subviewAtIndex(int index) {
assert(index == 0);
return &m_pointerTextView;
}
void TitleCell::layoutSubviews() {
m_pointerTextView.setFrame(bounds());
}
}