X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fstyledlabel.cpp;h=38250ea27fd18308855bb29e05ac40616ef6b22d;hp=a87aa8ce77cee0b57eceeca13b3a79d200dee323;hb=79d9606c41f65c25df54758e064697208895d402;hpb=67a12e19088282f2218b602463cae3de5bb5baad diff --git a/src/uisupport/styledlabel.cpp b/src/uisupport/styledlabel.cpp index a87aa8ce..38250ea2 100644 --- a/src/uisupport/styledlabel.cpp +++ b/src/uisupport/styledlabel.cpp @@ -145,7 +145,7 @@ void StyledLabel::updateToolTip() { void StyledLabel::layout() { qreal h = 0; - qreal w = frameRect().width() - 2*frameWidth(); + qreal w = contentsRect().width(); _layout.beginLayout(); forever { @@ -163,11 +163,12 @@ void StyledLabel::layout() { update(); } -void StyledLabel::paintEvent(QPaintEvent *) { +void StyledLabel::paintEvent(QPaintEvent *e) { + QFrame::paintEvent(e); QPainter painter(this); - qreal y = (frameRect().height() - _layout.boundingRect().height()) / 2; - _layout.draw(&painter, QPointF(0, y), _extraLayoutList); + qreal y = contentsRect().y() + (contentsRect().height() - _layout.boundingRect().height()) / 2; + _layout.draw(&painter, QPointF(contentsRect().x(), y), _extraLayoutList); } int StyledLabel::posToCursor(const QPointF &pos) {