Added a color menu in graph and list

This commit is contained in:
Joachim LF
2020-12-29 19:56:21 +01:00
parent e9b35efe16
commit f7210e5a20
11 changed files with 227 additions and 49 deletions

View File

@@ -8,11 +8,10 @@ ListParameterController::ListParameterController(Responder * parentResponder, I1
ViewController(parentResponder),
m_selectableTableView(this, this, this, tableDelegate),
m_record(),
#if FUNCTION_COLOR_CHOICE
m_colorCell(functionColorMessage),
#endif
m_enableCell(I18n::Message::ActivateDeactivate),
m_deleteCell(deleteFunctionMessage)
m_deleteCell(deleteFunctionMessage),
m_colorParameterController(parentResponder, functionColorMessage)
{
}
@@ -64,11 +63,7 @@ int ListParameterController::indexFromCumulatedHeight(KDCoordinate offsetY) {
HighlightCell * ListParameterController::reusableCell(int index, int type) {
assert(index == 0);
assert(index < totalNumberOfCells());
#if FUNCTION_COLOR_CHOICE
HighlightCell * cells[] = {&m_colorCell, &m_enableCell, &m_deleteCell};
#else
HighlightCell * cells[] = {&m_enableCell, &m_deleteCell};
#endif
return cells[type];
}
@@ -78,22 +73,17 @@ int ListParameterController::typeAtLocation(int i, int j) {
bool ListParameterController::handleEnterOnRow(int rowIndex) {
switch (rowIndex) {
#if FUNCTION_COLOR_CHOICE
case 0:
/* TODO: implement function color choice */
case 0: {
StackViewController * stack = (StackViewController *)(parentResponder());
m_colorParameterController.setRecord(m_record);
stack->push(&m_colorParameterController);
return true;
}
case 1:
#else
case 0:
#endif
function()->setActive(!function()->isActive());
m_selectableTableView.reloadData();
return true;
#if FUNCTION_COLOR_CHOICE
case 2:
#else
case 1:
#endif
case 2:
{
assert(functionStore()->numberOfModels() > 0);
functionStore()->removeModel(m_record);