Files
Upsilon/escher/src/pointer_table_cell_with_buffer.cpp
Émilie Feral 2e16365100 [escher] Reorganize all cells'name and factorize their layouts
Change-Id: I69900ee98ff6a6868f96d70a0e335a589ef16c3f
2017-02-20 10:54:02 +01:00

33 lines
970 B
C++

#include <escher/pointer_table_cell_with_buffer.h>
#include <escher/palette.h>
PointerTableCellWithBuffer::PointerTableCellWithBuffer(char * label) :
PointerTableCell(label),
m_accessoryView(BufferTextView(KDText::FontSize::Large, 1.0f, 0.5f))
{
}
void PointerTableCellWithBuffer::setAccessoryText(const char * textBody) {
m_accessoryView.setText(textBody);
reloadCell();
}
const char * PointerTableCellWithBuffer::accessoryText() {
return m_accessoryView.text();
}
View * PointerTableCellWithBuffer::accessoryView() const {
return (View *)&m_accessoryView;
}
void PointerTableCellWithBuffer::setHighlighted(bool highlight) {
PointerTableCell::setHighlighted(highlight);
KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite;
m_accessoryView.setBackgroundColor(backgroundColor);
}
void PointerTableCellWithBuffer::setTextColor(KDColor color) {
m_accessoryView.setTextColor(color);
PointerTableCell::setTextColor(color);
}