Files
Upsilon/escher/src/expression_table_cell_with_pointer.cpp
Émilie Feral 4bd3dfd542 [escher] TableCell: the subviews are layoutted horizontally or
vertically. We add an option to decide which subviews should overlap on
top of the other if there is not enough space
2020-02-12 15:13:20 +01:00

27 lines
951 B
C++

#include <escher/expression_table_cell_with_pointer.h>
#include <escher/palette.h>
#include <assert.h>
ExpressionTableCellWithPointer::ExpressionTableCellWithPointer(Responder * parentResponder, I18n::Message accessoryMessage, Layout layout) :
ExpressionTableCell(parentResponder, layout),
m_accessoryView(KDFont::SmallFont, accessoryMessage, 0.0f, 0.5f, Palette::GreyDark, KDColorWhite)
{
if (layout != Layout::Vertical) {
m_accessoryView.setAlignment(1.0f, 0.5f);
}
}
View * ExpressionTableCellWithPointer::accessoryView() const {
return (View *)&m_accessoryView;
}
void ExpressionTableCellWithPointer::setHighlighted(bool highlight) {
ExpressionTableCell::setHighlighted(highlight);
KDColor backgroundColor = highlight? Palette::Select : KDColorWhite;
m_accessoryView.setBackgroundColor(backgroundColor);
}
void ExpressionTableCellWithPointer::setAccessoryMessage(I18n::Message text) {
m_accessoryView.setMessage(text);
}