Files
Upsilon/escher/src/text_menu_list_cell.cpp
Émilie Feral d45000b3d9 [escher] In palette, improve colors
Change-Id: I2c8f33764cf2befeb994b9b47b46d39f116ae96c
2017-01-27 11:46:05 +01:00

38 lines
1.0 KiB
C++

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