From 00bb1b7ac1c1caaef3ef3116afb0ebc756fe52ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 24 Sep 2019 17:32:42 +0200 Subject: [PATCH] [apps/graph] ValuesController: column width are different for parametric functions --- apps/graph/values/values_controller.cpp | 16 +++++++++++++++ apps/graph/values/values_controller.h | 4 ++++ apps/sequence/values/values_controller.cpp | 24 ++++++++++++++++++++++ apps/sequence/values/values_controller.h | 5 +++++ apps/shared/values_controller.cpp | 24 ---------------------- apps/shared/values_controller.h | 5 ----- 6 files changed, 49 insertions(+), 29 deletions(-) diff --git a/apps/graph/values/values_controller.cpp b/apps/graph/values/values_controller.cpp index b3e5efff9..6d9c000a6 100644 --- a/apps/graph/values/values_controller.cpp +++ b/apps/graph/values/values_controller.cpp @@ -42,6 +42,22 @@ ValuesController::ValuesController(Responder * parentResponder, InputEventHandle m_selectableTableView.setDelegate(this); } +KDCoordinate ValuesController::columnWidth(int i) { + ContinuousFunction::PlotType plotType = plotTypeAtColumn(&i); + if (i > 0 && plotType == ContinuousFunction::PlotType::Parametric) { + return 2*k_cellWidth; + } + return k_cellWidth; +} + +KDCoordinate ValuesController::cumulatedWidthFromIndex(int i) { + return TableViewDataSource::cumulatedWidthFromIndex(i); +} + +int ValuesController::indexFromCumulatedWidth(KDCoordinate offsetX) { + return TableViewDataSource::indexFromCumulatedWidth(offsetX); +} + Shared::Hideable * ValuesController::hideableCellFromType(HighlightCell * cell, int type) { if (type == k_notEditableValueCellType) { Shared::HideableEvenOddBufferTextCell * myCell = static_cast(cell); diff --git a/apps/graph/values/values_controller.h b/apps/graph/values/values_controller.h index 6320329ac..95da02dc2 100644 --- a/apps/graph/values/values_controller.h +++ b/apps/graph/values/values_controller.h @@ -20,6 +20,9 @@ public: Button * buttonAtIndex(int index, ButtonRowController::Position position) const override { return const_cast