[apps/sequence] Personalize the button "add a function" for sequence app

Change-Id: Ie84757feec57a934c80573ad24b71e868c0d7b81
This commit is contained in:
Émilie Feral
2017-02-08 16:30:55 +01:00
parent 81b0f58fd8
commit 4ba14c8597
6 changed files with 10 additions and 15 deletions

View File

@@ -7,7 +7,7 @@ using namespace Shared;
namespace Graph {
ListController::ListController(Responder * parentResponder, FunctionStore * functionStore, HeaderViewController * header) :
Shared::ListController(parentResponder, functionStore, header),
Shared::ListController(parentResponder, functionStore, header, "Ajouter une fonction"),
m_functionTitleCells{FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator), FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator), FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator),
FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator), FunctionTitleCell(FunctionTitleCell::Orientation::VerticalIndicator)},
m_parameterController(ListParameterController(this, functionStore))

View File

@@ -6,7 +6,7 @@ using namespace Shared;
namespace Sequence {
ListController::ListController(Responder * parentResponder, SequenceStore * sequenceStore, HeaderViewController * header) :
Shared::ListController(parentResponder, sequenceStore, header),
Shared::ListController(parentResponder, sequenceStore, header, "Ajouter une suite"),
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)),

View File

@@ -3,11 +3,12 @@
namespace Shared {
ListController::ListController(Responder * parentResponder, FunctionStore * functionStore, HeaderViewController * header) :
ListController::ListController(Responder * parentResponder, FunctionStore * functionStore, HeaderViewController * header, const char * text) :
ViewController(parentResponder),
HeaderViewDelegate(header),
m_selectableTableView(SelectableTableView(this, this, 0, 0, 0, 0, nullptr, false, true)),
m_functionStore(functionStore)
m_functionStore(functionStore),
m_addNewFunction(text)
{
}

View File

@@ -10,7 +10,7 @@ namespace Shared {
class ListController : public ViewController, public HeaderViewDelegate, public TableViewDataSource {
public:
ListController(Responder * parentResponder, FunctionStore * functionStore, HeaderViewController * header);
ListController(Responder * parentResponder, FunctionStore * functionStore, HeaderViewController * header, const char * text);
View * view() override;
int numberOfRows() override;
int numberOfColumns() override;

View File

@@ -3,11 +3,10 @@
namespace Shared {
NewFunctionCell::NewFunctionCell() :
NewFunctionCell::NewFunctionCell(const char * text) :
EvenOddCell(),
m_pointerTextView(PointerTextView(KDText::FontSize::Large, nullptr, 0.5f, 0.5f))
m_pointerTextView(PointerTextView(KDText::FontSize::Large, text, 0.5f, 0.5f))
{
m_pointerTextView.setText(text());
}
void NewFunctionCell::reloadCell() {
@@ -28,8 +27,4 @@ void NewFunctionCell::layoutSubviews() {
m_pointerTextView.setFrame(bounds());
}
const char * NewFunctionCell::text() {
return "Ajouter une fonction";
}
}

View File

@@ -7,13 +7,12 @@ namespace Shared {
class NewFunctionCell : public EvenOddCell {
public:
NewFunctionCell();
NewFunctionCell(const char * text);
void reloadCell() override;
int numberOfSubviews() const override;
View * subviewAtIndex(int index) override;
void layoutSubviews() override;
protected:
virtual const char * text();
private:
PointerTextView m_pointerTextView;
};