mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 09:17:23 +01:00
[escher] In pointer text view (future message text view) implement
minimal size for optimal display to ensure to be able to display all languages Change-Id: Id3c81185fa44017bc4fcca5db0c8d0a6c115f6fb
This commit is contained in:
@@ -20,3 +20,13 @@ void PointerTextView::setMessage(I18n::Message message) {
|
||||
m_message = message;
|
||||
markRectAsDirty(bounds());
|
||||
}
|
||||
|
||||
KDSize PointerTextView::minimalSizeForOptimalDisplay() const {
|
||||
KDCoordinate width = 0;
|
||||
for (int l = 0; l < I18n::numberOfLanguages(); l++) {
|
||||
KDCoordinate newWidth = KDText::stringSize(I18n::translate(m_message, (I18n::Language)l), m_fontSize).width();
|
||||
width = width > newWidth ? width : newWidth;
|
||||
l++;
|
||||
}
|
||||
return KDSize(width, KDText::stringSize(text(), m_fontSize).height());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user