diff --git a/apps/code/variable_box_controller.cpp b/apps/code/variable_box_controller.cpp index e2928835a..f4397fe46 100644 --- a/apps/code/variable_box_controller.cpp +++ b/apps/code/variable_box_controller.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -228,7 +229,7 @@ void VariableBoxController::ContentViewController::willDisplayCellForIndex(Highl } KDCoordinate VariableBoxController::ContentViewController::rowHeight(int index) { - return k_rowHeight; + return Metric::ToolboxRowHeight; } KDCoordinate VariableBoxController::ContentViewController::cumulatedHeightFromIndex(int j) { diff --git a/apps/code/variable_box_controller.h b/apps/code/variable_box_controller.h index f5b6fb9f6..d14b6049a 100644 --- a/apps/code/variable_box_controller.h +++ b/apps/code/variable_box_controller.h @@ -52,7 +52,6 @@ private: private: constexpr static int k_maxNumberOfDisplayedRows = 6; //240/40 constexpr static int k_numberOfMenuRows = 2; - constexpr static KDCoordinate k_rowHeight = 40; //TODO fix constexpr static int k_nodeType = 0; constexpr static int k_leafType = 1; constexpr static int k_functionsAndVarsNamePointersArrayLength = 32; diff --git a/apps/variable_box_controller.cpp b/apps/variable_box_controller.cpp index caed30184..0b6ce0c01 100644 --- a/apps/variable_box_controller.cpp +++ b/apps/variable_box_controller.cpp @@ -1,5 +1,6 @@ #include "variable_box_controller.h" #include "constant.h" +#include #include using namespace Poincare; @@ -163,11 +164,8 @@ void VariableBoxController::ContentViewController::willDisplayCellForIndex(Highl } KDCoordinate VariableBoxController::ContentViewController::rowHeight(int index) { - if (m_currentPage == Page::RootMenu) { - return k_nodeRowHeight; - } - if (m_currentPage == Page::Scalar) { - return k_leafRowHeight; + if (m_currentPage == Page::RootMenu || m_currentPage == Page::Scalar) { + return Metric::ToolboxRowHeight; } const Expression * expression = expressionForIndex(index); if (expression) { @@ -176,7 +174,7 @@ KDCoordinate VariableBoxController::ContentViewController::rowHeight(int index) delete layout; return expressionHeight+k_leafMargin; } - return k_leafRowHeight; + return Metric::ToolboxRowHeight; } KDCoordinate VariableBoxController::ContentViewController::cumulatedHeightFromIndex(int j) { diff --git a/apps/variable_box_controller.h b/apps/variable_box_controller.h index 802d2f30d..45218cd74 100644 --- a/apps/variable_box_controller.h +++ b/apps/variable_box_controller.h @@ -50,9 +50,7 @@ private: #else constexpr static int k_numberOfMenuRows = 2; #endif - constexpr static KDCoordinate k_leafRowHeight = 40; constexpr static KDCoordinate k_leafMargin = 10; - constexpr static KDCoordinate k_nodeRowHeight = 40; Page pageAtIndex(int index); void putLabelAtIndexInBuffer(int index, char * buffer); I18n::Message nodeLabelAtIndex(int index); diff --git a/escher/include/escher/metric.h b/escher/include/escher/metric.h index 888904cb6..cb62d2724 100644 --- a/escher/include/escher/metric.h +++ b/escher/include/escher/metric.h @@ -24,6 +24,7 @@ public: constexpr static KDCoordinate ExamPopUpTopMargin = 27; constexpr static KDCoordinate ExamPopUpBottomMargin = 55; constexpr static KDCoordinate StoreRowHeight = 50; + constexpr static KDCoordinate ToolboxRowHeight = 40; }; #endif diff --git a/escher/include/escher/toolbox.h b/escher/include/escher/toolbox.h index ca8fdecca..30a87bd22 100644 --- a/escher/include/escher/toolbox.h +++ b/escher/include/escher/toolbox.h @@ -68,7 +68,6 @@ protected: static constexpr int LeafCellType = 0; static constexpr int NodeCellType = 1; - static constexpr KDCoordinate sToolboxRowHeight = 40; int stackDepth(); bool handleEventForRow(Ion::Events::Event event, int selectedRow); bool selectSubMenu(ToolboxMessageTree * selectedMessageTree); diff --git a/escher/src/toolbox.cpp b/escher/src/toolbox.cpp index 511420643..9205cb655 100644 --- a/escher/src/toolbox.cpp +++ b/escher/src/toolbox.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -119,7 +120,7 @@ void Toolbox::viewDidDisappear() { } KDCoordinate Toolbox::rowHeight(int j) { - return sToolboxRowHeight; + return Metric::ToolboxRowHeight; } int Toolbox::numberOfRows() {