viewerdisplay: fixed inconsistencies with cursor
This commit is contained in:
@@ -796,7 +796,7 @@ bool ViewerDisplayWidget::OnMousePress(QMouseEvent *event)
|
|||||||
hand_last_drag_pos_ = event->pos();
|
hand_last_drag_pos_ = event->pos();
|
||||||
hand_dragging_ = true;
|
hand_dragging_ = true;
|
||||||
emit HandDragStarted();
|
emit HandDragStarted();
|
||||||
setCursor(Qt::ClosedHandCursor);
|
inner_widget()->setCursor(Qt::ClosedHandCursor);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -854,9 +854,9 @@ bool ViewerDisplayWidget::OnMouseMove(QMouseEvent *event)
|
|||||||
if (event->buttons() == Qt::NoButton) {
|
if (event->buttons() == Qt::NoButton) {
|
||||||
QPointF mapped = text_transform_inverted_.map(event->pos()) - text_edit_pos_;
|
QPointF mapped = text_transform_inverted_.map(event->pos()) - text_edit_pos_;
|
||||||
if (mapped.x() >= 0 && mapped.y() >= 0 && mapped.x() < text_edit_->width() && mapped.y() < text_edit_->height()) {
|
if (mapped.x() >= 0 && mapped.y() >= 0 && mapped.x() < text_edit_->width() && mapped.y() < text_edit_->height()) {
|
||||||
setCursor(Qt::IBeamCursor);
|
inner_widget()->setCursor(Qt::IBeamCursor);
|
||||||
} else {
|
} else {
|
||||||
unsetCursor();
|
inner_widget()->unsetCursor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1292,6 +1292,7 @@ void ViewerDisplayWidget::TextEditDestroyed()
|
|||||||
text_toolbar_ = nullptr;
|
text_toolbar_ = nullptr;
|
||||||
inner_widget()->setMouseTracking(false);
|
inner_widget()->setMouseTracking(false);
|
||||||
inner_widget()->setFocusPolicy(Qt::NoFocus);
|
inner_widget()->setFocusPolicy(Qt::NoFocus);
|
||||||
|
UpdateCursor();
|
||||||
disconnect(qApp, &QApplication::focusChanged, this, &ViewerDisplayWidget::FocusChanged);
|
disconnect(qApp, &QApplication::focusChanged, this, &ViewerDisplayWidget::FocusChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user