diff --git a/escher/include/escher/text_field.h b/escher/include/escher/text_field.h index 26b7e682d..e725b6743 100644 --- a/escher/include/escher/text_field.h +++ b/escher/include/escher/text_field.h @@ -17,6 +17,7 @@ public: const char * textBuffer() const; int bufferLength() const; void setTextBuffer(const char * text); + KDSize minimalSizeForOptimalDisplay() override; protected: #if ESCHER_VIEW_LOGGING const char * className() const override; diff --git a/escher/src/text_field.cpp b/escher/src/text_field.cpp index cd9c72981..d66fc0402 100644 --- a/escher/src/text_field.cpp +++ b/escher/src/text_field.cpp @@ -72,3 +72,8 @@ void TextField::setTextBuffer(const char * text) { m_currentTextLength = strlen(text); markRectAsDirty(bounds()); } + +KDSize TextField::minimalSizeForOptimalDisplay() { + KDSize textSize = KDText::stringSize(m_textBuffer); + return KDSize(0, textSize.height()); +}