- in Tcl Shell Dock widget make sure that the context menu is not shown on the title bar and middle clicking on the title bar will close the widget
This commit is contained in:
@@ -16,6 +16,7 @@ CHANGELOG for FlatCAM beta
|
||||
- Drilling Tool - remade the 'Beginner/Advanced' Mode
|
||||
- Milling Tool - fixed the ever-growing list of preprocessor's
|
||||
- in all Object UI's fixed the Properties section columns resize to content on expansion/collapse of the items
|
||||
- in Tcl Shell Dock widget make sure that the context menu is not shown on the title bar and middle clicking on the title bar will close the widget
|
||||
|
||||
8.12.2020
|
||||
|
||||
|
||||
@@ -4292,6 +4292,15 @@ class FCDock(QtWidgets.QDockWidget):
|
||||
super(FCDock, self).__init__(*args)
|
||||
self.close_callback = kwargs["close_callback"] if "close_callback" in kwargs else None
|
||||
|
||||
self.setContextMenuPolicy(Qt.PreventContextMenu)
|
||||
|
||||
def mousePressEvent(self, event: QtGui.QMouseEvent) -> None:
|
||||
if event.button() == Qt.MiddleButton:
|
||||
try:
|
||||
self.close_callback()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def closeEvent(self, event: QtGui.QCloseEvent) -> None:
|
||||
self.close_callback()
|
||||
super().closeEvent(event)
|
||||
|
||||
Reference in New Issue
Block a user