Workout Editor Block Cursor

.. just to get used to it and see how it might work, when
   we start working with blocks as well as points.
This commit is contained in:
Mark Liversedge
2016-01-02 16:17:28 +00:00
parent b9bcd5fd90
commit c8ee808916
2 changed files with 45 additions and 7 deletions

View File

@@ -133,7 +133,7 @@ WorkoutWidget::eventFilter(QObject *obj, QEvent *event)
//
//
// 1 MOUSE MOVE
// 1 MOUSE MOVE [we always repaint]
//
if (event->type() == QEvent::MouseMove) {
@@ -157,12 +157,10 @@ WorkoutWidget::eventFilter(QObject *obj, QEvent *event)
if (point->bounding().contains(p)) {
if (!point->hover) {
point->hover = true;
updateNeeded=true;
}
} else {
if (point->hover) {
point->hover = false;
updateNeeded=true;
}
}
}
@@ -173,7 +171,7 @@ WorkoutWidget::eventFilter(QObject *obj, QEvent *event)
// we're dragging this point around, get on and
// do that, but apply constrains
if (dragging) {
updateNeeded = movePoint(p);
movePoint(p);
// this may possibly be too expensive
// on slower hardware?
@@ -188,8 +186,11 @@ WorkoutWidget::eventFilter(QObject *obj, QEvent *event)
// we're selecting via a rectangle
atRect = p;
updateNeeded=selectPoints(); // go and check / select
selectPoints(); // go and check / select
}
// always repaint...
repaint();
}
//