From 293bc61b4928f100c35652aa3979d8f03a8724cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 8 Oct 2018 15:52:25 +0200 Subject: [PATCH] [apps] VariableBoxController: add "(x)" to function symbols --- apps/variable_box_controller.cpp | 5 ++++- apps/variable_box_controller.h | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/variable_box_controller.cpp b/apps/variable_box_controller.cpp index 8b12bd092..2d812725c 100644 --- a/apps/variable_box_controller.cpp +++ b/apps/variable_box_controller.cpp @@ -62,8 +62,11 @@ void VariableBoxController::willDisplayCellForIndex(HighlightCell * cell, int in } ExpressionTableCellWithExpression * myCell = (ExpressionTableCellWithExpression *)cell; Storage::Record record = recordAtIndex(index); - char truncatedName[SymbolAbstract::k_maxNameSize]; + char truncatedName[SymbolAbstract::k_maxNameSize+k_functionArgLength]; size_t nameLength = SymbolAbstract::TruncateExtension(truncatedName, record.fullName(), SymbolAbstract::k_maxNameSize); + if (m_currentPage == Page::Function) { + nameLength += strlcpy(truncatedName+nameLength, k_functionArg, k_functionArgLength+1); + } Layout symbolLayout = LayoutHelper::String(truncatedName, nameLength); myCell->setLayout(symbolLayout); myCell->setAccessoryLayout(expressionLayoutForRecord(record)); diff --git a/apps/variable_box_controller.h b/apps/variable_box_controller.h index 790360fbb..266d42595 100644 --- a/apps/variable_box_controller.h +++ b/apps/variable_box_controller.h @@ -30,7 +30,9 @@ private: RootMenu, Expression, Function - }; + }; + constexpr static int k_functionArgLength = 3; + constexpr static const char * k_functionArg = "(x)"; constexpr static int k_maxNumberOfDisplayedRows = 6; //240/Metric::ToolboxRowHeight constexpr static int k_numberOfMenuRows = 2; constexpr static KDCoordinate k_leafMargin = 20;