Files
Upsilon/apps/shared/list_parameter_controller.h
Yaya-Cout 3b293c822a [apps/graph] Added a color menu in graph and list (#189)
* Revert "[github/workflows] Update Metrics to remove NumWorksBot"

This reverts commit 110f333122.

* Added a color menu in graph and list

* Fixed color select display issue and build issue

* Changed color_cell to a circle

* Revert "Changed color_cell to a circle"

This reverts commit 28dddb42af.

* Color_cell with mask

* Fixed build issue

* Color selection : Added right handle and color name display in menu

* Fixed constexpr static colorMask

* Changed font in color_parameter_controller

* Fix building without debug

* Re-Fix building without debug

* Update colors

Co-authored-by: Hugo Saint-Vignes <hugo.saint-vignes@numworks.com>
Co-authored-by: Joachim LF <joachimlf@pm.me>
2022-03-23 08:36:23 +01:00

51 lines
1.8 KiB
C++

#ifndef SHARED_LIST_PARAM_CONTROLLER_H
#define SHARED_LIST_PARAM_CONTROLLER_H
#include <escher.h>
#include "function_store.h"
#include "color_parameter_controller.h"
#include <apps/i18n.h>
namespace Shared {
class ListParameterController : public ViewController, public ListViewDataSource, public SelectableTableViewDataSource {
public:
ListParameterController(Responder * parentResponder, I18n::Message functionColorMessage, I18n::Message deleteFunctionMessage, SelectableTableViewDelegate * tableDelegate = nullptr);
View * view() override { return &m_selectableTableView; }
const char * title() override;
bool handleEvent(Ion::Events::Event event) override;
TELEMETRY_ID("ListParameter");
void setRecord(Ion::Storage::Record record);
void didBecomeFirstResponder() override;
void viewWillAppear() override;
int numberOfRows() const override { return totalNumberOfCells(); }
// ListViewDataSource
KDCoordinate rowHeight(int j) override { return Metric::ParameterCellHeight; }
KDCoordinate cumulatedHeightFromIndex(int j) override;
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
HighlightCell * reusableCell(int index, int type) override;
int reusableCellCount(int type) override { return 1; }
int typeAtLocation(int i, int j) override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
protected:
virtual bool handleEnterOnRow(int rowIndex);
virtual int totalNumberOfCells() const {
return 3;
}
FunctionStore * functionStore();
ExpiringPointer<Function> function();
SelectableTableView m_selectableTableView;
Ion::Storage::Record m_record;
private:
MessageTableCellWithChevronAndMessage m_colorCell;
MessageTableCellWithSwitch m_enableCell;
MessageTableCell m_deleteCell;
ColorParameterController m_colorParameterController;
};
}
#endif