[escher] create a class float table view cell

Change-Id: Ie0d0e701d60ccdd492760bcdc5857470fcd1a255
This commit is contained in:
Émilie Feral
2016-10-14 09:55:32 +02:00
parent a7fdf442a9
commit b8b52e2d73
4 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
#include <escher/float_table_view_cell.h>
FloatTableViewCell::FloatTableViewCell(char * label) :
TableViewCell(label),
m_contentView(FloatView())
{
}
void FloatTableViewCell::setFloat(float f) {
m_contentView.setFloat(f);
}
char * FloatTableViewCell::stringFromFloat() {
return m_contentView.buffer();
}
View * FloatTableViewCell::contentView() const {
return (View *)&m_contentView;
}
void FloatTableViewCell::setHighlighted(bool highlight) {
TableViewCell::setHighlighted(highlight);
KDColor backgroundColor = highlight? Palette::FocusCellBackgroundColor : Palette::CellBackgroundColor;
m_contentView.setBackgroundColor(backgroundColor);
}