diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 7b4654d0..395f1683 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -1793,8 +1793,6 @@ class App(QtCore.QObject): # decide if we have a double click or single click self.doubleclick = False - # variable to store if there was motion before right mouse button click (panning) - self.panning_action = False # variable to store if a command is active (then the var is not None) and which one it is self.command_active = None # variable to store the status of moving selection action @@ -5139,15 +5137,13 @@ class App(QtCore.QObject): self.plotcanvas.vispy_canvas.native.setFocus() self.pos_jump = event.pos - if origin_click is True: - pass - else: + self.ui.popMenu.mouse_is_panning = False + + if origin_click != True: # if the RMB is clicked and mouse is moving over plot then 'panning_action' is True - if event.button == 2: - self.panning_action = True + if event.button == 2 and event.is_dragging == 1: + self.ui.popMenu.mouse_is_panning = True return - else: - self.panning_action = False if self.rel_point1 is not None: try: # May fail in case mouse not within axes @@ -5235,12 +5231,12 @@ class App(QtCore.QObject): # canvas menu try: if event.button == 2: # right click - if self.panning_action is True: - self.panning_action = False - else: + if self.ui.popMenu.mouse_is_panning is False: + self.cursor = QtGui.QCursor() self.populate_cmenu_grids() self.ui.popMenu.popup(self.cursor.pos()) + except Exception as e: log.warning("Error: %s" % str(e)) return diff --git a/README.md b/README.md index 697d3c34..125df7be 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing. ================================================= +26.04.2019 + +- small changes in GUI + 25.04.2019 - Geometry Editor: modified the intersection (if the selected shapes don't intersects preserve them) and substract functions (delete all shapes that were used in the process) diff --git a/flatcamGUI/FlatCAMGUI.py b/flatcamGUI/FlatCAMGUI.py index bdcfe934..34f685c3 100644 --- a/flatcamGUI/FlatCAMGUI.py +++ b/flatcamGUI/FlatCAMGUI.py @@ -1546,7 +1546,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow): ############################################################## ### HERE WE BUILD THE CONTEXT MENU FOR RMB CLICK ON CANVAS ### ############################################################## - self.popMenu = QtWidgets.QMenu() + self.popMenu = FCMenu() self.popmenu_disable = self.popMenu.addAction(QtGui.QIcon('share/clear_plot32.png'), _("Disable")) self.popMenu.addSeparator() diff --git a/flatcamGUI/GUIElements.py b/flatcamGUI/GUIElements.py index c7b724f5..d5897de5 100644 --- a/flatcamGUI/GUIElements.py +++ b/flatcamGUI/GUIElements.py @@ -676,6 +676,16 @@ class FCButton(QtWidgets.QPushButton): self.setText(str(val)) +class FCMenu(QtWidgets.QMenu): + def __init__(self): + super().__init__() + self.mouse_is_panning = False + + def popup(self, pos, action=None): + self.mouse_is_panning = False + super().popup(pos) + + class FCTab(QtWidgets.QTabWidget): def __init__(self, parent=None): super(FCTab, self).__init__(parent) diff --git a/locale/de/LC_MESSAGES/strings.mo b/locale/de/LC_MESSAGES/strings.mo index db843e0e..c0e85a17 100644 Binary files a/locale/de/LC_MESSAGES/strings.mo and b/locale/de/LC_MESSAGES/strings.mo differ diff --git a/locale/de/LC_MESSAGES/strings.po b/locale/de/LC_MESSAGES/strings.po index af137464..526bd977 100644 --- a/locale/de/LC_MESSAGES/strings.po +++ b/locale/de/LC_MESSAGES/strings.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: 2019-04-23 17:13+0300\n" -"PO-Revision-Date: 2019-04-23 17:43+0300\n" +"PO-Revision-Date: 2019-04-26 02:23+0300\n" "Last-Translator: \n" "Language-Team: \n" "Language: de\n" @@ -9403,9 +9403,10 @@ msgid "" "Click the header to select all, or Ctrl + LMB\n" "for custom selection of tools." msgstr "" -"Fügen Sie mindestens ein Werkzeug in der Werkzeugtabelle hinzu.\n" -"Klicken Sie auf die Kopfzeile, um alle auszuwählen, oder drücken Sie Strg + " -"LMB\n" +"Fügen Sie mindestens ein Werkzeug in \n" +"der Werkzeugtabelle hinzu.\n" +"Klicken Sie auf die Kopfzeile, um alle auszuwählen, \n" +"oder drücken Sie Strg + LMB\n" "zur benutzerdefinierten Auswahl von Werkzeugen." #: flatcamGUI/ObjectUI.py:1285