Mercurial > hg > svgui
diff view/View.cpp @ 630:c3593bb2de6b
Use italic for value labels (as opposed to label labels)
author | Chris Cannam |
---|---|
date | Tue, 16 Apr 2013 10:06:10 +0100 |
parents | 5b72899d692b |
children | 0aea4b9e4c3d |
line wrap: on
line diff
--- a/view/View.cpp Mon Apr 15 10:54:02 2013 +0100 +++ b/view/View.cpp Tue Apr 16 10:06:10 2013 +0100 @@ -731,10 +731,16 @@ void View::drawVisibleText(QPainter &paint, int x, int y, QString text, TextStyle style) const { - if (style == OutlinedText) { + if (style == OutlinedText || style == OutlinedItalicText) { paint.save(); + if (style == OutlinedItalicText) { + QFont f(paint.font()); + f.setItalic(true); + paint.setFont(f); + } + QColor penColour, surroundColour, boxColour; penColour = getForeground(); @@ -744,6 +750,7 @@ paint.setPen(Qt::NoPen); paint.setBrush(boxColour); + QRect r = paint.fontMetrics().boundingRect(text); r.translate(QPoint(x, y)); // std::cerr << "drawVisibleText: r = " << r.x() << "," <<r.y() << " " << r.width() << "x" << r.height() << std::endl;