[apps/sequence] Improve sequence title cell

Change-Id: I09091c5a2d4b3175494715f7b63b6d3fe94509bd
This commit is contained in:
Émilie Feral
2017-02-08 15:08:02 +01:00
parent 8cfdc66e48
commit 962b4de74c
5 changed files with 31 additions and 39 deletions

View File

@@ -7,7 +7,7 @@ namespace Sequence {
ListController::ListController(Responder * parentResponder, SequenceStore * sequenceStore, HeaderViewController * header) :
Shared::ListController(parentResponder, sequenceStore, header),
m_functionTitleCells{SequenceTitleCell(&m_selectableTableView),SequenceTitleCell(&m_selectableTableView),SequenceTitleCell(&m_selectableTableView)},
m_functionTitleCells{SequenceTitleCell(&m_selectableTableView, &m_parameterController),SequenceTitleCell(&m_selectableTableView, &m_parameterController),SequenceTitleCell(&m_selectableTableView, &m_parameterController)},
m_expressionCells{SequenceExpressionCell(&m_selectableTableView),SequenceExpressionCell(&m_selectableTableView),SequenceExpressionCell(&m_selectableTableView)},
m_parameterController(ListParameterController(this, sequenceStore)),
m_typeParameterController(this, sequenceStore),
@@ -102,19 +102,7 @@ TableViewCell * ListController::expressionCells(int index) {
void ListController::willDisplayTitleCellAtIndex(TableViewCell * cell, int j) {
SequenceTitleCell * myCell = (SequenceTitleCell *)cell;
Sequence * sequence = ((SequenceStore *)m_functionStore)->functionAtIndex(j);
myCell->setNumberOfSubCells((int)sequence->type()+1);
char bufferName[5] = {*sequence->name(),'(',sequence->symbol(),')', 0};
myCell->setDefinitionText(bufferName);
if ((int)sequence->type() > 0) {
char bufferName[7] = {*sequence->name(),'(',sequence->symbol(),'+','1',')', 0};
myCell->setFirstInitialConditionText(bufferName);
}
if ((int)sequence->type() > 1) {
char bufferName[7] = {*sequence->name(),'(',sequence->symbol(),'+','2',')', 0};
myCell->setSecondInitialConditionText(bufferName);
}
KDColor functionNameColor = sequence->isActive() ? sequence->color() : Palette::GreyDark;
myCell->setColor(functionNameColor);
myCell->setSequence(sequence);
}
void ListController::willDisplayExpressionCellAtIndex(TableViewCell * cell, int j) {