- default values for Jump To function is jumping to origin (0, 0)
This commit is contained in:
parent
5ef11a56cc
commit
57176b7e28
@ -4407,7 +4407,7 @@ class App(QtCore.QObject):
|
|||||||
|
|
||||||
self.plotcanvas.vis_connect('mouse_press', self.on_set_zero_click)
|
self.plotcanvas.vis_connect('mouse_press', self.on_set_zero_click)
|
||||||
|
|
||||||
def on_jump_to(self, custom_location=None):
|
def on_jump_to(self, custom_location=None, fit_center=True):
|
||||||
"""
|
"""
|
||||||
Jump to a location by setting the mouse cursor location
|
Jump to a location by setting the mouse cursor location
|
||||||
:return:
|
:return:
|
||||||
@ -4433,6 +4433,7 @@ class App(QtCore.QObject):
|
|||||||
else:
|
else:
|
||||||
location = custom_location
|
location = custom_location
|
||||||
|
|
||||||
|
if fit_center:
|
||||||
self.plotcanvas.fit_center(loc=location)
|
self.plotcanvas.fit_center(loc=location)
|
||||||
|
|
||||||
cursor = QtGui.QCursor()
|
cursor = QtGui.QCursor()
|
||||||
|
@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
7.04.2019
|
||||||
|
|
||||||
|
- default values for Jump To function is jumping to origin (0, 0)
|
||||||
|
|
||||||
6.04.2019
|
6.04.2019
|
||||||
|
|
||||||
- fixed bug in Geometry Editor in buffer_int() function that created an Circular Reference Error when applying buffer interior on a geometry.
|
- fixed bug in Geometry Editor in buffer_int() function that created an Circular Reference Error when applying buffer interior on a geometry.
|
||||||
@ -27,7 +31,7 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
- WIP in Gerber Editor
|
- WIP in Gerber Editor
|
||||||
- fixed bug in saving the maximized state
|
- fixed bug in saving the maximized state
|
||||||
- fixed bug in applying default language on first start
|
- fixed bug in applying default language on first start
|
||||||
- on activating 'V' key shortcut (zoom fit) the mouse cursor is now jumping to origin (0, 0)
|
~~- on activating 'V' key shortcut (zoom fit) the mouse cursor is now jumping to origin (0, 0)~~
|
||||||
- fixed bug in saving toolbars state; the file was saved before setting the self.defaults['global_toolbar_view]
|
- fixed bug in saving toolbars state; the file was saved before setting the self.defaults['global_toolbar_view]
|
||||||
|
|
||||||
4.04.2019
|
4.04.2019
|
||||||
|
@ -2088,8 +2088,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
# Zoom Fit
|
# Zoom Fit
|
||||||
if key == QtCore.Qt.Key_V:
|
if key == QtCore.Qt.Key_V:
|
||||||
self.app.on_zoom_fit(None)
|
self.app.on_zoom_fit(None)
|
||||||
# and move mouse cursor to origin
|
|
||||||
self.app.on_jump_to(custom_location=(0, 0))
|
|
||||||
|
|
||||||
# Mirror on X the selected object(s)
|
# Mirror on X the selected object(s)
|
||||||
if key == QtCore.Qt.Key_X:
|
if key == QtCore.Qt.Key_X:
|
||||||
@ -2355,8 +2353,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
if key == QtCore.Qt.Key_V or key == 'V':
|
if key == QtCore.Qt.Key_V or key == 'V':
|
||||||
self.app.on_zoom_fit(None)
|
self.app.on_zoom_fit(None)
|
||||||
# and move mouse cursor to origin
|
|
||||||
self.app.on_jump_to(custom_location=(0, 0))
|
|
||||||
|
|
||||||
# Flip on X axis
|
# Flip on X axis
|
||||||
if key == QtCore.Qt.Key_X or key == 'X':
|
if key == QtCore.Qt.Key_X or key == 'X':
|
||||||
@ -2536,8 +2532,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
if key == QtCore.Qt.Key_V or key == 'V':
|
if key == QtCore.Qt.Key_V or key == 'V':
|
||||||
self.app.grb_editor.launched_from_shortcuts = True
|
self.app.grb_editor.launched_from_shortcuts = True
|
||||||
self.app.on_zoom_fit(None)
|
self.app.on_zoom_fit(None)
|
||||||
# and move mouse cursor to origin
|
|
||||||
self.app.on_jump_to(custom_location=(0, 0))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# Propagate to tool
|
# Propagate to tool
|
||||||
@ -2735,8 +2729,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
if key == QtCore.Qt.Key_V or key == 'V':
|
if key == QtCore.Qt.Key_V or key == 'V':
|
||||||
self.app.exc_editor.launched_from_shortcuts = True
|
self.app.exc_editor.launched_from_shortcuts = True
|
||||||
self.app.on_zoom_fit(None)
|
self.app.on_zoom_fit(None)
|
||||||
# and move mouse cursor to origin
|
|
||||||
self.app.on_jump_to(custom_location=(0, 0))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# Propagate to tool
|
# Propagate to tool
|
||||||
|
@ -1463,7 +1463,20 @@ class Dialog_box(QtWidgets.QWidget):
|
|||||||
dialog_box.setFixedWidth(290)
|
dialog_box.setFixedWidth(290)
|
||||||
self.setWindowIcon(icon)
|
self.setWindowIcon(icon)
|
||||||
|
|
||||||
self.location, self.ok = dialog_box.getText(self, title, label)
|
self.location, self.ok = dialog_box.getText(self, title, label, text="0, 0")
|
||||||
|
self.readyToEdit = True
|
||||||
|
|
||||||
|
def mousePressEvent(self, e, parent=None):
|
||||||
|
super(Dialog_box, self).mousePressEvent(e) # required to deselect on 2e click
|
||||||
|
if self.readyToEdit:
|
||||||
|
self.lineEdit().selectAll()
|
||||||
|
self.readyToEdit = False
|
||||||
|
|
||||||
|
def focusOutEvent(self, e):
|
||||||
|
super(Dialog_box, self).focusOutEvent(e) # required to remove cursor on focusOut
|
||||||
|
self.lineEdit().deselect()
|
||||||
|
self.readyToEdit = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class _BrowserTextEdit(QTextEdit):
|
class _BrowserTextEdit(QTextEdit):
|
||||||
|
Loading…
Reference in New Issue
Block a user