From 3bc35323586d2f04c0dada91046cb47daef31240 Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Thu, 10 Oct 2019 15:09:32 +0200 Subject: [PATCH] [escher/expression_field] Replace maximalHeight() by k_maximalHeight To harmonize with k_minimalHeight --- escher/include/escher/expression_field.h | 2 +- escher/src/expression_field.cpp | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/escher/include/escher/expression_field.h b/escher/include/escher/expression_field.h index 8b1310fbb..1c2c701aa 100644 --- a/escher/include/escher/expression_field.h +++ b/escher/include/escher/expression_field.h @@ -40,11 +40,11 @@ public: private: static constexpr int k_textFieldBufferSize = TextField::maxBufferSize(); static constexpr KDCoordinate k_minimalHeight = 37; + static constexpr KDCoordinate k_maximalHeight = 0.6*Ion::Display::Height; static constexpr KDCoordinate k_horizontalMargin = 5; static constexpr KDCoordinate k_verticalMargin = 5; constexpr static KDCoordinate k_separatorThickness = Metric::CellSeparatorThickness; KDCoordinate inputViewHeight() const; - KDCoordinate maximalHeight() const; TextField m_textField; LayoutField m_layoutField; }; diff --git a/escher/src/expression_field.cpp b/escher/src/expression_field.cpp index 7d274ed8f..268d20507 100644 --- a/escher/src/expression_field.cpp +++ b/escher/src/expression_field.cpp @@ -100,7 +100,7 @@ bool ExpressionField::isEmpty() const { } bool ExpressionField::heightIsMaximal() const { - return inputViewHeight() == k_separatorThickness + maximalHeight(); + return inputViewHeight() == k_separatorThickness + k_maximalHeight; } bool ExpressionField::handleEventWithText(const char * text, bool indentation, bool forceCursorRightOfText) { @@ -114,10 +114,6 @@ bool ExpressionField::handleEventWithText(const char * text, bool indentation, b KDCoordinate ExpressionField::inputViewHeight() const { return k_separatorThickness + (editionIsInTextField() ? k_minimalHeight : - minCoordinate(maximalHeight(), + minCoordinate(k_maximalHeight, maxCoordinate(k_minimalHeight, m_layoutField.minimalSizeForOptimalDisplay().height()))); } - -KDCoordinate ExpressionField::maximalHeight() const { - return 0.6*Ion::Display::Height; -}