- small changes in GUI

This commit is contained in:
Marius Stanciu
2019-04-26 02:31:21 +03:00
parent ac3833f746
commit 8eb390e706
6 changed files with 28 additions and 17 deletions

View File

@@ -1793,8 +1793,6 @@ class App(QtCore.QObject):
# decide if we have a double click or single click # decide if we have a double click or single click
self.doubleclick = False 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 # variable to store if a command is active (then the var is not None) and which one it is
self.command_active = None self.command_active = None
# variable to store the status of moving selection action # variable to store the status of moving selection action
@@ -5139,15 +5137,13 @@ class App(QtCore.QObject):
self.plotcanvas.vispy_canvas.native.setFocus() self.plotcanvas.vispy_canvas.native.setFocus()
self.pos_jump = event.pos self.pos_jump = event.pos
if origin_click is True: self.ui.popMenu.mouse_is_panning = False
pass
else: if origin_click != True:
# if the RMB is clicked and mouse is moving over plot then 'panning_action' is True # if the RMB is clicked and mouse is moving over plot then 'panning_action' is True
if event.button == 2: if event.button == 2 and event.is_dragging == 1:
self.panning_action = True self.ui.popMenu.mouse_is_panning = True
return return
else:
self.panning_action = False
if self.rel_point1 is not None: if self.rel_point1 is not None:
try: # May fail in case mouse not within axes try: # May fail in case mouse not within axes
@@ -5235,12 +5231,12 @@ class App(QtCore.QObject):
# canvas menu # canvas menu
try: try:
if event.button == 2: # right click if event.button == 2: # right click
if self.panning_action is True: if self.ui.popMenu.mouse_is_panning is False:
self.panning_action = False
else:
self.cursor = QtGui.QCursor() self.cursor = QtGui.QCursor()
self.populate_cmenu_grids() self.populate_cmenu_grids()
self.ui.popMenu.popup(self.cursor.pos()) self.ui.popMenu.popup(self.cursor.pos())
except Exception as e: except Exception as e:
log.warning("Error: %s" % str(e)) log.warning("Error: %s" % str(e))
return return

View File

@@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
================================================= =================================================
26.04.2019
- small changes in GUI
25.04.2019 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) - 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)

View File

@@ -1546,7 +1546,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
############################################################## ##############################################################
### HERE WE BUILD THE CONTEXT MENU FOR RMB CLICK ON CANVAS ### ### 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_disable = self.popMenu.addAction(QtGui.QIcon('share/clear_plot32.png'), _("Disable"))
self.popMenu.addSeparator() self.popMenu.addSeparator()

View File

@@ -676,6 +676,16 @@ class FCButton(QtWidgets.QPushButton):
self.setText(str(val)) 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): class FCTab(QtWidgets.QTabWidget):
def __init__(self, parent=None): def __init__(self, parent=None):
super(FCTab, self).__init__(parent) super(FCTab, self).__init__(parent)

Binary file not shown.

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: 2019-04-23 17:13+0300\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" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: de\n" "Language: de\n"
@@ -9403,9 +9403,10 @@ msgid ""
"Click the header to select all, or Ctrl + LMB\n" "Click the header to select all, or Ctrl + LMB\n"
"for custom selection of tools." "for custom selection of tools."
msgstr "" msgstr ""
"Fügen Sie mindestens ein Werkzeug in der Werkzeugtabelle hinzu.\n" "Fügen Sie mindestens ein Werkzeug in \n"
"Klicken Sie auf die Kopfzeile, um alle auszuwählen, oder drücken Sie Strg + " "der Werkzeugtabelle hinzu.\n"
"LMB\n" "Klicken Sie auf die Kopfzeile, um alle auszuwählen, \n"
"oder drücken Sie Strg + LMB\n"
"zur benutzerdefinierten Auswahl von Werkzeugen." "zur benutzerdefinierten Auswahl von Werkzeugen."
#: flatcamGUI/ObjectUI.py:1285 #: flatcamGUI/ObjectUI.py:1285