[apps/graph/graph] Add a banner view in the graph view

Change-Id: Iafa0dcfc730911264d5b045c14bde54f432f53a2
This commit is contained in:
Émilie Feral
2016-12-20 11:31:53 +01:00
parent 30fb8307bc
commit ba67ef4a2e
4 changed files with 31 additions and 12 deletions

View File

@@ -6,7 +6,6 @@ namespace Graph {
CurveParameterController::CurveParameterController(GraphView * graphView) :
ViewController(nullptr),
m_graphView(graphView),
m_displayDerivative(false),
m_function(nullptr),
m_calculationCell(ChevronMenuListCell((char*)"Calculer")),
m_goToCell(ChevronMenuListCell((char*)"Aller a")),
@@ -33,7 +32,7 @@ void CurveParameterController::didBecomeFirstResponder() {
void CurveParameterController::willDisplayCellForIndex(TableViewCell * cell, int index) {
if (cell == &m_derivativeCell) {
SwitchView * switchView = (SwitchView *)m_derivativeCell.accessoryView();
switchView->setState(m_displayDerivative);
switchView->setState(m_graphView->bannerView()->displayDerivative());
}
}
@@ -50,7 +49,7 @@ bool CurveParameterController::handleEvent(Ion::Events::Event event) {
return true;
}
case 2:
m_displayDerivative = !m_displayDerivative;
m_graphView->bannerView()->setDisplayDerivative(!m_graphView->bannerView()->displayDerivative());
m_selectableTableView.reloadData();
return true;
default:
@@ -79,10 +78,6 @@ KDCoordinate CurveParameterController::cellHeight() {
return 35;
}
bool CurveParameterController::displayDerivative() const {
return m_displayDerivative;
}
void CurveParameterController::setFunction(Function * function) {
m_function = function;
}