Files
Upsilon/escher/src/even_odd_buffer_text_cell.cpp
Émilie Feral 24fc727b53 [escher] Uniformize methods in menu list cell and even odd cells
Change-Id: Idccb55bdfe0ff2010fd06bd5796b8c324469446b
2017-02-16 14:46:04 +01:00

40 lines
1.1 KiB
C++

#include <escher/even_odd_buffer_text_cell.h>
#include <assert.h>
EvenOddBufferTextCell::EvenOddBufferTextCell(KDText::FontSize size, float horizontalAlignment, float verticalAlignment) :
EvenOddCell(),
m_bufferTextView(BufferTextView(size, horizontalAlignment, verticalAlignment))
{
}
void EvenOddBufferTextCell::setHighlighted(bool highlight) {
EvenOddCell::setHighlighted(highlight);
m_bufferTextView.setBackgroundColor(backgroundColor());
}
void EvenOddBufferTextCell::setEven(bool even) {
EvenOddCell::setEven(even);
m_bufferTextView.setBackgroundColor(backgroundColor());
}
void EvenOddBufferTextCell::setText(const char * textContent) {
m_bufferTextView.setText(textContent);
}
void EvenOddBufferTextCell::setTextColor(KDColor textColor) {
m_bufferTextView.setTextColor(textColor);
}
int EvenOddBufferTextCell::numberOfSubviews() const {
return 1;
}
View * EvenOddBufferTextCell::subviewAtIndex(int index) {
assert(index == 0);
return &m_bufferTextView;
}
void EvenOddBufferTextCell::layoutSubviews() {
m_bufferTextView.setFrame(bounds());
}