- const double cursor_offset = _offset + _scale * offset;
- _scale *= pow(3.0/2.0, -steps);
- _scale = max(min(_scale, MaxScale), MinScale);
- _offset = cursor_offset - _scale * offset;
- _viewport->update();
- update_scroll();
+ int offset = SignalMargin + SignalHeight;
+ const vector< shared_ptr<Signal> > sigs(_session.get_signals());
+ BOOST_FOREACH(shared_ptr<Signal> s, sigs) {
+ s->set_v_offset(offset);
+ offset += SignalHeight + 2 * SignalMargin;
+ }
+
+ normalize_layout();
+}
+
+bool View::eventFilter(QObject *object, QEvent *event)
+{
+ const QEvent::Type type = event->type();
+ if (type == QEvent::MouseMove) {
+
+ const QMouseEvent *const mouse_event = (QMouseEvent*)event;
+ if (object == _viewport)
+ _hover_point = mouse_event->pos();
+ else if (object == _ruler)
+ _hover_point = QPoint(mouse_event->x(), 0);
+ else if (object == _header)
+ _hover_point = QPoint(0, mouse_event->y());
+ else
+ _hover_point = QPoint(-1, -1);
+
+ hover_point_changed();
+
+ } else if (type == QEvent::Leave) {
+ _hover_point = QPoint(-1, -1);
+ hover_point_changed();
+ }
+
+ return QObject::eventFilter(object, event);