+ setViewportMargins(
+ header_->sizeHint().width() - pv::view::Header::BaselineOffset,
+ ruler_->sizeHint().height(), 0, 0);
+ ruler_->setGeometry(viewport_->x(), 0,
+ viewport_->width(), viewport_->y());
+ cursorheader_->setGeometry(
+ viewport_->x(),
+ ruler_->sizeHint().height() - cursorheader_->sizeHint().height() / 2,
+ viewport_->width(), cursorheader_->sizeHint().height());
+ header_->setGeometry(0, viewport_->y(),
+ header_->sizeHint().width(), viewport_->height());
+ update_scroll();
+}
+
+void View::paint_label(QPainter &p, const QRect &rect, bool hover)
+{
+ (void)p;
+ (void)rect;
+ (void)hover;
+}
+
+QRectF View::label_rect(const QRectF &rect)
+{
+ (void)rect;
+ return QRectF();
+}
+
+bool View::add_channels_to_owner(
+ const vector< shared_ptr<sigrok::Channel> > &channels,
+ RowItemOwner *owner, int &offset,
+ unordered_map<shared_ptr<sigrok::Channel>, shared_ptr<Signal> >
+ &signal_map,
+ std::function<bool (shared_ptr<RowItem>)> filter_func)
+{
+ bool any_added = false;
+
+ assert(owner);
+
+ for (const auto &channel : channels)
+ {
+ const auto iter = signal_map.find(channel);
+ if (iter == signal_map.end() ||
+ (filter_func && !filter_func((*iter).second)))
+ continue;
+
+ shared_ptr<RowItem> row_item = (*iter).second;
+ owner->add_child_item(row_item);
+ apply_offset(row_item, offset);
+ signal_map.erase(iter);
+
+ any_added = true;
+ }
+
+ return any_added;
+}
+
+void View::apply_offset(shared_ptr<RowItem> row_item, int &offset) {
+ assert(row_item);
+ const pair<int, int> extents = row_item->v_extents();
+ if (row_item->enabled())
+ offset += -extents.first;
+ row_item->force_to_v_offset(offset);
+ if (row_item->enabled())
+ offset += extents.second;