[apps/sequence/list] Create a class sequence expression cell inheriting

from function expression cell

Change-Id: Icaec669c684ebbaa353f6801ca2f976e5fb76a9a
This commit is contained in:
Émilie Feral
2017-02-07 14:30:04 +01:00
parent 460e692309
commit 7b9dbb88a5
5 changed files with 166 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ namespace Shared {
FunctionExpressionCell::FunctionExpressionCell() :
EvenOddCell(),
m_function(nullptr),
m_expressionView(ExpressionView())
m_expressionView(EvenOddExpressionCell())
{
}
@@ -17,7 +17,6 @@ void FunctionExpressionCell::setFunction(Function * f) {
void FunctionExpressionCell::reloadCell() {
EvenOddCell::reloadCell();
m_expressionView.setBackgroundColor(backgroundColor());
if (m_function) {
bool active = m_function->isActive();
KDColor textColor = active ? KDColorBlack : Palette::GreyDark;
@@ -25,6 +24,16 @@ void FunctionExpressionCell::reloadCell() {
}
}
void FunctionExpressionCell::setEven(bool even) {
EvenOddCell::setEven(even);
m_expressionView.setEven(even);
}
void FunctionExpressionCell::setHighlighted(bool highlight) {
EvenOddCell::setHighlighted(highlight);
m_expressionView.setHighlighted(highlight);
}
Function * FunctionExpressionCell::function() {
return m_function;
}