Fix warning and remove cursor pair selected state

Fixes warning "QObject::connect: Cannot connect (nullptr)::closed() to pv::views::trace::Ruler::on_popup_closed()" and
removes showing the selected state for the cursor pair as it doesn't serve a purpose.
This commit is contained in:
Soeren Apel 2023-10-18 01:58:33 +02:00
parent 499f68de03
commit 5f0ea35639
2 changed files with 6 additions and 4 deletions

View File

@ -202,11 +202,13 @@ void CursorPair::paint_label(QPainter &p, const QRect &rect, bool hover)
text_size_ = p.boundingRect(QRectF(), 0, text).size();
/* Currently, selecting the middle section between two cursors doesn't do
* anything, so don't highlight it when selected
if (selected()) {
p.setBrush(Qt::transparent);
p.setPen(highlight_pen());
p.drawRoundedRect(delta_rect, radius, radius);
}
} */
p.setBrush(hover ? Cursor::FillColor.lighter() : Cursor::FillColor);
p.setPen(Cursor::FillColor.darker());

View File

@ -48,10 +48,10 @@ void MarginWidget::show_popup(const shared_ptr<ViewItem> &item)
{
pv::widgets::Popup *const p = item->create_popup(this);
connect(p, SIGNAL(closed()), this, SLOT(on_popup_closed()));
if (p)
if (p) {
connect(p, SIGNAL(closed()), this, SLOT(on_popup_closed()));
p->show();
}
}
void MarginWidget::contextMenuEvent(QContextMenuEvent *event)