[apps/graph] Use TextFieldWithExtension in the list controller

This commit is contained in:
Léa Saviot
2018-10-17 10:17:09 +02:00
committed by Émilie Feral
parent f8df2a2fba
commit 6facfbbf7a
3 changed files with 4 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ namespace Graph {
TextFieldFunctionTitleCell::TextFieldFunctionTitleCell(StorageListController * listController, Orientation orientation, KDText::FontSize size) :
Shared::FunctionTitleCell(orientation),
Responder(listController),
m_textField(this, m_textFieldBuffer, m_textFieldBuffer, k_textFieldBufferSize, listController, false, size, 0.5f, 0.5f)
m_textField(Shared::StorageFunction::k_parenthesedArgumentLength, this, m_textFieldBuffer, m_textFieldBuffer, k_textFieldBufferSize, listController, false, size, 0.5f, 0.5f)
{}
void TextFieldFunctionTitleCell::setHighlighted(bool highlight) {
@@ -20,7 +20,6 @@ void TextFieldFunctionTitleCell::setEditing(bool editing) {
const char * previousText = m_textField.text();
m_textField.setEditing(true, false);
m_textField.setText(previousText);
m_textField.setCursorLocation(strlen(previousText) - strlen("(x)"));
}
void TextFieldFunctionTitleCell::setEven(bool even) {

View File

@@ -2,6 +2,7 @@
#define GRAPH_LIST_TEXT_FIELD_FUNCTION_TITLE_CELL_H
#include <apps/shared/function_title_cell.h>
#include <apps/shared/text_field_with_extension.h>
namespace Graph {
@@ -29,7 +30,7 @@ protected:
KDRect textFieldFrame() const;
private:
constexpr static int k_textFieldBufferSize = TextField::maxBufferSize();
TextField m_textField;
Shared::TextFieldWithExtension m_textField;
char m_textFieldBuffer[k_textFieldBufferSize];
};

View File

@@ -12,7 +12,7 @@ public:
char * textBuffer,
char * draftTextBuffer,
size_t textBufferSize,
TextFieldDelegate * delegate = nullptr,
::TextFieldDelegate * delegate = nullptr,
bool hasTwoBuffers = true,
KDText::FontSize size = KDText::FontSize::Large,
float horizontalAlignment = 0.0f,