[escher] Implement minimlSizeForOptimalDisplay in text view and button

Change-Id: I86cbc1cc9314623a1deb69f2dd36ac8c45338d92
This commit is contained in:
Émilie Feral
2016-10-13 09:53:06 +02:00
parent 76c99f8944
commit c28f7bc6c7
6 changed files with 15 additions and 13 deletions

View File

@@ -53,6 +53,7 @@ void Button::setBackgroundColor(KDColor backgroundColor) {
markRectAsDirty(bounds());
}
KDSize Button::textSize() {
return m_textView.textSize();
KDSize Button::minimalSizeForOptimalDisplay() {
KDSize textSize = m_textView.minimalSizeForOptimalDisplay();
return KDSize(textSize.width() + k_horizontalMargin, textSize.height() + k_verticalMargin);
}