- styledText = QtUi::style()->styleString(Message::mircToInternal(text));
- setText(styledText.text);
+ if(QAbstractButton::text() == text)
+ return;
+
+ setText(text); // this triggers a repaint event
+
+#ifndef SPUTDEV
+ styledContents = QtUi::style()->styleString(Message::mircToInternal(text));
+ int height = 1;
+ foreach(QTextLayout::FormatRange fr, styledContents.formatList) {
+ height = qMax(height, QFontMetrics(fr.format.font()).height());
+ }
+
+ // ensure the button is editable (height != 1) if there is no text to show
+ if(text.isEmpty())
+ height = QFontMetrics(qApp->font()).height();