[escher] Reorganize all cells'name and factorize their layouts

Change-Id: I69900ee98ff6a6868f96d70a0e335a589ef16c3f
This commit is contained in:
Émilie Feral
2017-02-17 10:56:21 +01:00
parent 4a1735c29e
commit 2e16365100
149 changed files with 903 additions and 914 deletions

View File

@@ -0,0 +1,26 @@
#include <escher/expression_table_cell_with_pointer.h>
#include <escher/palette.h>
#include <assert.h>
ExpressionTableCellWithPointer::ExpressionTableCellWithPointer(char * accessoryText, Layout layout) :
ExpressionTableCell(layout),
m_accessoryView(PointerTextView(KDText::FontSize::Small, accessoryText, 0.0f, 0.5f, Palette::GreyDark, KDColorWhite))
{
if (layout == Layout::Horizontal) {
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::setAccessoryText(const char * text) {
m_accessoryView.setText(text);
}