Part of the local time in the upper left corner and part of the location indicator in the lower left corner are cropped.
I want it to be displayed without being croped.
I believe the "current code" below is incorrectly written to increase the height by 1 pixel per line if m_shaded is true.
I believe the correct code is as in "my suggested code".
Current code
int h = fm.height() * (m_shaded ? 1 : m_strings.size());
My proposed code
int h = (fm.height() + (m_shaded ? 1 : 0 )) * m_strings.size();
void InfoBoxWidget::updateSize(){
QFontMetrics fm(font());
int w = 0;
foreach (const QString &str, m_strings){
w = qMax(w, fm.horizontalAdvance(str));
}
int h = fm.height() * (m_shaded ? 1 : m_strings.size());
// Add padding
resize(w + 2 * padX, h + 2 * padY + 2);
adjust();
}