this, SLOT(on_action_set_name_triggered()));
connect(_action_set_colour, SIGNAL(triggered()),
this, SLOT(on_action_set_colour_triggered()));
+
+ connect(&_view, SIGNAL(signals_moved()),
+ this, SLOT(on_signals_moved()));
}
boost::shared_ptr<pv::view::Signal> Header::get_mouse_over_signal(
const vector< shared_ptr<Signal> > &sigs =
_view.session().get_signals();
- if(~QApplication::keyboardModifiers() & Qt::ControlModifier) {
- // Unselect all other signals because the Ctrl is not
- // pressed
- _drag_sigs.clear();
- BOOST_FOREACH(const shared_ptr<Signal> s, sigs)
- s->select(false);
- }
-
if(event->button() & Qt::LeftButton) {
_mouse_down_point = event->pos();
else {
mouse_over_signal->select(true);
+ if(~QApplication::keyboardModifiers() &
+ Qt::ControlModifier)
+ _drag_sigs.clear();
+
// Add the signal to the drag list
- _drag_sigs.push_back(
- make_pair(mouse_over_signal,
+ if(event->button() & Qt::LeftButton)
+ _drag_sigs.push_back(
+ make_pair(mouse_over_signal,
mouse_over_signal->get_v_offset()));
}
}
+ if(~QApplication::keyboardModifiers() & Qt::ControlModifier) {
+ // Unselect all other signals because the Ctrl is not
+ // pressed
+ BOOST_FOREACH(const shared_ptr<Signal> s, sigs)
+ if(s != mouse_over_signal)
+ s->select(false);
+ }
+
update();
}
context_signal->set_colour(new_colour);
}
+void Header::on_signals_moved()
+{
+ update();
+}
+
+
} // namespace view
} // namespace pv
this, SLOT(marker_time_changed()));
connect(_header, SIGNAL(signals_moved()),
- this, SLOT(signals_moved()));
+ this, SLOT(on_signals_moved()));
setViewportMargins(LabelMarginWidth, RulerHeight, 0, 0);
setViewport(_viewport);
_viewport->update();
}
-void View::signals_moved()
+void View::on_signals_moved()
{
- _header->update();
- _viewport->update();
+ update_scroll();
+ signals_moved();
}
} // namespace view
setMouseTracking(true);
setAutoFillBackground(true);
setBackgroundRole(QPalette::Base);
+
+ connect(&_view, SIGNAL(signals_moved()),
+ this, SLOT(on_signals_moved()));
}
int Viewport::get_total_height() const
{
- int height = 0;
+ int h = 0;
BOOST_FOREACH(const shared_ptr<Signal> s,
_view.session().get_signals()) {
assert(s);
- height += View::SignalHeight;
+ h = max(s->get_v_offset() + View::SignalHeight, h);
}
- return height;
+ return h;
}
void Viewport::paintEvent(QPaintEvent *event)
cursors.second.paint(p, r);
}
+void Viewport::on_signals_moved()
+{
+ update();
+}
+
} // namespace view
} // namespace pv