From 9f4aafd6b6a9e499bab01acf400219558e42388a Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Wed, 17 Jun 2020 17:44:45 +0200 Subject: [PATCH] [apps/graph] FunctionTitleCell reload Changed TextFieldFunctionTitleCell::reloadCell to solve an issue with the alignment of a function's name and definition when changing the expression : - typing u_n = (1/3)/2 then changing to u_n = 1/(2/3) without erasing the formula first. u_n would no longer be aligned with the = sign. Change-Id: Ib58e4220dc67c77639272c7ea784418bddffb432 --- apps/graph/list/text_field_function_title_cell.cpp | 5 +++++ apps/graph/list/text_field_function_title_cell.h | 1 + 2 files changed, 6 insertions(+) diff --git a/apps/graph/list/text_field_function_title_cell.cpp b/apps/graph/list/text_field_function_title_cell.cpp index 38f0284f2..a4ef2a48b 100644 --- a/apps/graph/list/text_field_function_title_cell.cpp +++ b/apps/graph/list/text_field_function_title_cell.cpp @@ -62,6 +62,11 @@ void TextFieldFunctionTitleCell::layoutSubviews(bool force) { m_textField.setAlignment(horizontalAlignment, verticalAlignment()); } +void TextFieldFunctionTitleCell::reloadCell() { + layoutSubviews(); + FunctionTitleCell::reloadCell(); +} + void TextFieldFunctionTitleCell::didBecomeFirstResponder() { if (isEditing()) { Container::activeApp()->setFirstResponder(&m_textField); diff --git a/apps/graph/list/text_field_function_title_cell.h b/apps/graph/list/text_field_function_title_cell.h index dd76523e5..05d6dcab7 100644 --- a/apps/graph/list/text_field_function_title_cell.h +++ b/apps/graph/list/text_field_function_title_cell.h @@ -35,6 +35,7 @@ public: return &m_textField; } void layoutSubviews(bool force = false) override; + void reloadCell() override; // Responder void didBecomeFirstResponder() override;