X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Ftimemarker.cpp;h=4b8d2b527a5992dc43c4e58f15c68d02dcf0312d;hb=c009650038207adcb66938170cbeb36bdf9ed63f;hp=ed9df36064f74407b1a1ee81f80d11378adbc81c;hpb=98cfe4e8dadad2cf710eb46fd5c85d9d0520a875;p=pulseview.git diff --git a/pv/view/timemarker.cpp b/pv/view/timemarker.cpp index ed9df36..4b8d2b5 100644 --- a/pv/view/timemarker.cpp +++ b/pv/view/timemarker.cpp @@ -87,7 +87,7 @@ QRectF TimeMarker::label_rect(const QRectF &rect) const QFontMetrics m(QApplication::font()); const float text_width = max(m.boundingRect(get_text()).size().width(), ArrowSize); - const float text_height = m.boundingRect("Tg").size().height(); + const float text_height = m.height(); const QSizeF label_size( text_width + View::LabelPadding.width() * 2, @@ -100,7 +100,7 @@ QRectF TimeMarker::label_rect(const QRectF &rect) const label_size.width(), height); } -void TimeMarker::paint_label(QPainter &p, const QRect &rect) +void TimeMarker::paint_label(QPainter &p, const QRect &rect, bool hover) { if (!enabled()) return; @@ -136,7 +136,7 @@ void TimeMarker::paint_label(QPainter &p, const QRect &rect) } p.setPen(Qt::transparent); - p.setBrush(colour_); + p.setBrush(hover ? colour_.lighter() : colour_); p.drawPolygon(points, countof(points)); p.setPen(colour_.lighter());