]> sigrok.org Git - pulseview.git/blobdiff - pv/view/viewitem.cpp
ViewItem: Added a default label_rect implementation
[pulseview.git] / pv / view / viewitem.cpp
index 55243860c0f4b342c86238fb9bae3f07968acf29..6ad6f6b64fbb515eb3426e13d3806754e8f862cc 100644 (file)
@@ -64,6 +64,12 @@ void ViewItem::drag_release()
        drag_point_ = QPoint(INT_MIN, INT_MIN);
 }
 
+QRectF ViewItem::label_rect(const QRectF &rect) const
+{
+       (void)rect;
+       return QRectF();
+}
+
 QRectF ViewItem::hit_box_rect(const QRectF &rect) const
 {
        (void)rect;
@@ -76,6 +82,12 @@ QMenu* ViewItem::create_context_menu(QWidget *parent)
        return new QMenu(parent);
 }
 
+widgets::Popup* ViewItem::create_popup(QWidget *parent)
+{
+       (void)parent;
+       return nullptr;
+}
+
 void ViewItem::delete_pressed()
 {
 }
@@ -87,6 +99,13 @@ QPen ViewItem::highlight_pen()
                Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
 }
 
+void ViewItem::paint_label(QPainter &p, const QRect &rect, bool hover)
+{
+       (void)p;
+       (void)rect;
+       (void)hover;
+}
+
 void ViewItem::paint_back(QPainter &p, const ViewItemPaintParams &pp)
 {
        (void)p;
@@ -107,7 +126,7 @@ void ViewItem::paint_fore(QPainter &p, const ViewItemPaintParams &pp)
 
 QColor ViewItem::select_text_colour(QColor background)
 {
-       return (background.lightness() > 64) ? Qt::black : Qt::white;
+       return (background.lightness() > 110) ? Qt::black : Qt::white;
 }
 
 } // namespace view