RowItemOwner: Renamed appearance_changed to row_item_appearance_changed
[pulseview.git] / pv / view / cursorpair.cpp
index ecce13893def06fb3e4c3f8559d412ef8d2fa5cc..859f6fdef4e129336b23cc038cddf6e31b107e73 100644 (file)
@@ -135,16 +135,17 @@ void CursorPair::paint_label(QPainter &p, const QRect &rect)
                p.setPen(Cursor::FillColour.lighter());
                p.drawRoundedRect(delta_rect, highlight_radius, highlight_radius);
 
-               p.setPen(SelectableItem::select_text_colour(
+               p.setPen(ViewItem::select_text_colour(
                        Cursor::FillColour));
                p.drawText(text_rect, Qt::AlignCenter | Qt::AlignVCenter,
                        pv::util::format_time(second_->time() - first_->time(), prefix, 2));
        }
 }
 
-void CursorPair::draw_viewport_background(QPainter &p,
-       const QRect &rect)
-{
+void CursorPair::paint_back(QPainter &p, const ViewItemPaintParams &pp) {
+       if (!enabled())
+               return;
+
        p.setPen(Qt::NoPen);
        p.setBrush(QBrush(View::CursorAreaColour));
 
@@ -152,19 +153,9 @@ void CursorPair::draw_viewport_background(QPainter &p,
        const int l = (int)max(min(
                offsets.first, offsets.second), 0.0f);
        const int r = (int)min(max(
-               offsets.first, offsets.second), (float)rect.width());
-
-       p.drawRect(l, 0, r - l, rect.height());
-}
-
-void CursorPair::draw_viewport_foreground(QPainter &p,
-       const QRect &rect)
-{
-       assert(first_);
-       assert(second_);
+               offsets.first, offsets.second), (float)pp.width());
 
-       first_->paint(p, rect);
-       second_->paint(p, rect);
+       p.drawRect(l, pp.top(), r - l, pp.height());
 }
 
 void CursorPair::compute_text_size(QPainter &p, unsigned int prefix)