|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
from enum import Enum |
|
|
|
|
|
|
|
|
|
from PyQt5.QtCore import QEvent, Qt |
|
|
|
|
from PyQt5.QtGui import QCursor |
|
|
|
|
|
|
|
|
|
from .exceptions import ExceededWindowBoundsError |
|
|
|
|
from .mode import Mode |
|
|
|
@ -156,12 +157,12 @@ def ogl_keypress_handler(ctx, event):
|
|
|
|
|
reset_move_bbs() |
|
|
|
|
refresh_point_list(ctx) |
|
|
|
|
|
|
|
|
|
elif ctx.mode in [Mode.ADD, Mode.EDIT, Mode.DELETE, Mode.OFF]: |
|
|
|
|
# Just clear selections |
|
|
|
|
PointManager.point_set.clear_selection() |
|
|
|
|
|
|
|
|
|
elif ctx.mode is not Mode.OFF: |
|
|
|
|
ctx.mode = Mode.OFF |
|
|
|
|
|
|
|
|
|
# Also change the mouse back to normal |
|
|
|
|
ctx.opengl_widget.setCursor(QCursor(Qt.CursorShape.ArrowCursor)) |
|
|
|
|
ctx.status_bar.showMessage("") |
|
|
|
|
|
|
|
|
|
ctx.opengl_widget.update() |
|
|
|
|
|
|
|
|
@ -182,9 +183,6 @@ def __handle_move_points(ctx, event):
|
|
|
|
|
|
|
|
|
|
__handle_info_updates(ctx, event) |
|
|
|
|
|
|
|
|
|
# Necessary to capture keyboard events |
|
|
|
|
ctx.opengl_widget.setFocusPolicy(Qt.StrongFocus) |
|
|
|
|
|
|
|
|
|
# If we release the mouse, we want to quickly alert drag mode. |
|
|
|
|
if (event.button() == Qt.LeftButton and |
|
|
|
|
event.type() == QEvent.MouseButtonRelease): |
|
|
|
|