eric6/E5Gui/E5ToolButton.py

changeset 8228
772103b14c18
parent 8218
7c09585bd960
child 8268
6b8128e0c9d1
--- a/eric6/E5Gui/E5ToolButton.py	Mon Apr 12 19:05:23 2021 +0200
+++ b/eric6/E5Gui/E5ToolButton.py	Mon Apr 12 19:21:40 2021 +0200
@@ -201,15 +201,12 @@
             self.__pressTimer.start()
         
         if (
-            evt.buttons() == Qt.MouseButton.LeftButton and
-            self.__menu is not None and
-            self.popupMode() == QToolButton.ToolButtonPopupMode.InstantPopup
-        ):
-            self.setDown(True)
-            self.__showMenu()
-        elif (
-            evt.buttons() == Qt.MouseButton.RightButton and
-            self.__menu is not None
+            (evt.buttons() == Qt.MouseButton.LeftButton and
+             self.__menu is not None and
+             (self.popupMode() ==
+              QToolButton.ToolButtonPopupMode.InstantPopup)) or
+            (evt.buttons() == Qt.MouseButton.RightButton and
+             self.__menu is not None)
         ):
             self.setDown(True)
             self.__showMenu()

eric ide

mercurial