mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/graph] Use TextFieldWithExtension in the list controller
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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];
|
||||
};
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user