X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fview%2Fviewitem.cpp;h=02a9c6a2f39d8deb9dcb0e0c4d3f11e1b1f16a93;hb=2155b66bed9f0802caec0b1e86f7f03d317a3e83;hp=0d83ee846f01547f609c91fac8a8c85f4b566208;hpb=26e3af6b15f083239981729b2c3c109ed1d87ba8;p=pulseview.git diff --git a/pv/view/viewitem.cpp b/pv/view/viewitem.cpp index 0d83ee84..02a9c6a2 100644 --- a/pv/view/viewitem.cpp +++ b/pv/view/viewitem.cpp @@ -29,12 +29,13 @@ namespace pv { namespace view { -const int ViewItem::HighlightRadius = 6; +const QSizeF ViewItem::LabelPadding(4, 0); +const int ViewItem::HighlightRadius = 3; ViewItem::ViewItem() : context_parent_(NULL), - selected_(false), - drag_point_(INT_MIN, INT_MIN) + drag_point_(INT_MIN, INT_MIN), + selected_(false) { } @@ -53,14 +54,9 @@ bool ViewItem::dragging() const return drag_point_.x() != INT_MIN && drag_point_.y() != INT_MIN; } -QPoint ViewItem::drag_point() const -{ - return drag_point_; -} - void ViewItem::drag() { - drag_point_ = point(); + drag_point_ = point(QRect()); } void ViewItem::drag_release() @@ -81,10 +77,28 @@ void ViewItem::delete_pressed() QPen ViewItem::highlight_pen() { return QPen(QApplication::palette().brush( - QPalette::Highlight), HighlightRadius, + QPalette::Highlight), HighlightRadius * 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); } +void ViewItem::paint_back(QPainter &p, const ViewItemPaintParams &pp) +{ + (void)p; + (void)pp; +} + +void ViewItem::paint_mid(QPainter &p, const ViewItemPaintParams &pp) +{ + (void)p; + (void)pp; +} + +void ViewItem::paint_fore(QPainter &p, const ViewItemPaintParams &pp) +{ + (void)p; + (void)pp; +} + QColor ViewItem::select_text_colour(QColor background) { return (background.lightness() > 64) ? Qt::black : Qt::white;