// Draw the hatching
draw_unresolved_period(p, annotation_height, pp.left(), pp.right());
- if ((int)visible_rows_.size() > max_visible_rows_)
- owner_->extents_changed(false, true);
+ if ((int)visible_rows_.size() > max_visible_rows_) {
+ max_visible_rows_ = (int)visible_rows_.size();
- // Update the maximum row count if needed
- max_visible_rows_ = max(max_visible_rows_, (int)visible_rows_.size());
+ // Call order is important, otherwise the lazy event handler won't work
+ owner_->extents_changed(false, true);
+ owner_->row_item_appearance_changed(false, true);
+ }
}
void DecodeTrace::paint_fore(QPainter &p, ViewItemPaintParams &pp)
QString() : annotations[0].annotations().front();
}
-void DecodeTrace::hover_point_changed()
+void DecodeTrace::hover_point_changed(const QPoint &hp)
{
assert(owner_);
const View *const view = owner_->view();
assert(view);
- QPoint hp = view->hover_point();
+ if (hp.x() == 0) {
+ QToolTip::hideText();
+ return;
+ }
+
QString ann = get_annotation_at_point(hp);
assert(view);
// If it did, the tool tip would constantly hide and re-appear.
// We also push it up by one row so that it appears above the
// decode trace, not below.
- hp.setX(hp.x() - (text_size.width() / 2) - padding);
+ QPoint p = hp;
+ p.setX(hp.x() - (text_size.width() / 2) - padding);
- hp.setY(get_visual_y() - (row_height_ / 2) +
+ p.setY(get_visual_y() - (row_height_ / 2) +
(hover_row * row_height_) -
row_height_ - text_size.height() - padding);
- QToolTip::showText(view->viewport()->mapToGlobal(hp), ann);
+ QToolTip::showText(view->viewport()->mapToGlobal(p), ann);
}
void DecodeTrace::create_decoder_form(int index,
{
decode_signal_->remove_decoder(index);
+ // Force re-calculation of the trace height, see paint_mid()
+ max_visible_rows_ = 0;
+ owner_->extents_changed(false, true);
+
// Update the popup
create_popup_form();
}
assert(index < (int)decoder_forms_.size());
decoder_forms_[index]->set_decoder_visible(state);
+ if (!state) {
+ // Force re-calculation of the trace height, see paint_mid()
+ max_visible_rows_ = 0;
+ owner_->extents_changed(false, true);
+ }
+
if (owner_)
owner_->row_item_appearance_changed(false, true);
}