X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fview%2Ftracegroup.cpp;h=b155778b37e354d99c2c6eb842faa7a3a887f8be;hb=3cc9ad7b867853315473df611612c562d562ed8a;hp=16b9d0cc80e7a9da9869342e6fac5bf189151476;hpb=8dbbc7f0b9ea59d0f0d62225772f8a56eee125f5;p=pulseview.git diff --git a/pv/view/tracegroup.cpp b/pv/view/tracegroup.cpp index 16b9d0cc..b155778b 100644 --- a/pv/view/tracegroup.cpp +++ b/pv/view/tracegroup.cpp @@ -26,7 +26,7 @@ #include #include -#include "tracegroup.h" +#include "tracegroup.hpp" using std::pair; using std::shared_ptr; @@ -52,13 +52,13 @@ bool TraceGroup::enabled() const [](const shared_ptr &r) { return r->enabled(); }); } -pv::SigSession& TraceGroup::session() +pv::Session& TraceGroup::session() { assert(owner_); return owner_->session(); } -const pv::SigSession& TraceGroup::session() const +const pv::Session& TraceGroup::session() const { assert(owner_); return owner_->session(); @@ -81,9 +81,9 @@ pair TraceGroup::v_extents() const return RowItemOwner::v_extents(); } -void TraceGroup::paint_label(QPainter &p, int right, bool hover) +void TraceGroup::paint_label(QPainter &p, const QRect &rect, bool hover) { - const QRectF r = label_rect(right).adjusted( + const QRectF r = label_rect(rect).adjusted( LineThickness / 2, LineThickness / 2, -LineThickness / 2, -LineThickness / 2); @@ -112,15 +112,15 @@ void TraceGroup::paint_label(QPainter &p, int right, bool hover) p.drawPolyline(points, countof(points)); } -QRectF TraceGroup::label_rect(int right) const +QRectF TraceGroup::label_rect(const QRectF &rect) const { - QRectF rect; + QRectF child_rect; for (const shared_ptr r : child_items()) if (r && r->enabled()) - rect = rect.united(r->label_rect(right)); + child_rect = child_rect.united(r->label_rect(rect)); - return QRectF(rect.x() - Width - Padding, rect.y(), - Width, rect.height()); + return QRectF(child_rect.x() - Width - Padding, child_rect.y(), + Width, child_rect.height()); } bool TraceGroup::pt_in_label_rect(int left, int right, const QPoint &point) @@ -212,10 +212,10 @@ void TraceGroup::on_ungroup() ungroup(); } -void TraceGroup::appearance_changed(bool label, bool content) +void TraceGroup::row_item_appearance_changed(bool label, bool content) { if (owner_) - owner_->appearance_changed(label, content); + owner_->row_item_appearance_changed(label, content); } void TraceGroup::extents_changed(bool horz, bool vert)