+
+ connect(&_view, SIGNAL(signals_moved()),
+ this, SLOT(on_signals_moved()));
+}
+
+QSize Header::sizeHint() const
+{
+ QRectF max_rect(-Padding, 0, Padding, 0);
+ for (auto &i : _view)
+ if (i->enabled())
+ max_rect = max_rect.united(i->label_rect(0));
+ return QSize(max_rect.width() + Padding + BaselineOffset, 0);
+}
+
+shared_ptr<RowItem> Header::get_mouse_over_row_item(const QPoint &pt)
+{
+ const int w = width() - BaselineOffset;
+ for (auto &i : _view)
+ if (i->enabled() && i->label_rect(w).contains(pt))
+ return i;
+ return shared_ptr<RowItem>();
+}
+
+void Header::clear_selection()
+{
+ for (auto &i : _view)
+ i->select(false);
+ update();
+}
+
+void Header::signals_updated()
+{
+ for (shared_ptr<RowItem> r : _view) {
+ assert(r);
+ connect(r.get(), SIGNAL(appearance_changed()),
+ this, SLOT(on_trace_changed()));
+ }
+}
+
+void Header::show_popup(const shared_ptr<RowItem> &item)
+{
+ using pv::widgets::Popup;
+
+ Popup *const p = item->create_popup(&_view);
+ if (!p)
+ return;
+
+ const QPoint pt(width() - BaselineOffset, item->get_visual_y());
+ p->set_position(mapToGlobal(pt), Popup::Right);
+ p->show();