| 92 | } |
| 93 | |
| 94 | void YACReader::MouseHandler::mouseMoveEvent(QMouseEvent *event) |
| 95 | { |
| 96 | viewer->showCursor(); |
| 97 | viewer->hideCursorTimer->start(2500); |
| 98 | |
| 99 | auto position = event->position(); |
| 100 | |
| 101 | if (viewer->magnifyingGlassShown) |
| 102 | viewer->mglass->move(static_cast<int>(position.x() - float(viewer->mglass->width()) / 2), static_cast<int>(position.y() - float(viewer->mglass->height()) / 2)); |
| 103 | |
| 104 | if (viewer->render->hasLoadedComic()) { |
| 105 | if (viewer->showGoToFlowAnimation->state() != QPropertyAnimation::Running) { |
| 106 | if (Configuration::getConfiguration().getDisableShowOnMouseOver() == false) { |
| 107 | if (viewer->goToFlow->isVisible()) { |
| 108 | QPoint gtfPos = viewer->goToFlow->mapFrom(this->viewer, event->pos()); |
| 109 | if (gtfPos.y() < 0 || gtfPos.x() < 0 || gtfPos.x() > viewer->goToFlow->width()) // TODO this extra check is for Mavericks (mouseMove over goToFlowGL seems to be broken) |
| 110 | viewer->animateHideGoToFlow(); |
| 111 | // goToFlow->hide(); |
| 112 | } else { |
| 113 | int umbral = (viewer->width() - viewer->goToFlow->width()) / 2; |
| 114 | if ((position.y() > viewer->height() - 15) && (position.x() > umbral) && (position.x() < viewer->width() - umbral)) { |
| 115 | |
| 116 | viewer->animateShowGoToFlow(); |
| 117 | viewer->hideCursorTimer->stop(); |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | if (viewer->drag) { |
| 124 | int currentPosY = viewer->verticalScrollBar()->sliderPosition(); |
| 125 | int currentPosX = viewer->horizontalScrollBar()->sliderPosition(); |
| 126 | viewer->verticalScrollBar()->setSliderPosition(currentPosY + (dragLatestPosition.y() - position.y())); |
| 127 | viewer->horizontalScrollBar()->setSliderPosition(currentPosX + (dragLatestPosition.x() - position.x())); |
| 128 | dragLatestPosition = position; |
| 129 | } |
| 130 | } |
| 131 | } |
nothing calls this directly
no test coverage detected