src/eric7/EricWidgets/EricMainWindow.py

branch
eric7
changeset 10933
95a15b70f7bb
parent 10439
21c28b0f9e41
child 11090
f5f5f5803935
diff -r 82de5109035a -r 95a15b70f7bb src/eric7/EricWidgets/EricMainWindow.py
--- a/src/eric7/EricWidgets/EricMainWindow.py	Fri Sep 27 11:00:27 2024 +0200
+++ b/src/eric7/EricWidgets/EricMainWindow.py	Fri Sep 27 17:27:11 2024 +0200
@@ -29,7 +29,7 @@
 
         self.defaultStyleName = QApplication.style().objectName()
 
-    def setStyle(self, styleName, styleSheetFile):
+    def setStyle(self, styleName, styleSheetFile, itemClickBehavior="default"):
         """
         Public method to set the style of the interface.
 
@@ -38,6 +38,9 @@
         @param styleSheetFile name of a style sheet file to read to overwrite
             defaults of the given style
         @type str
+        @param itemClickBehavior string describing the item activation behavior (one of
+            "default", "doubleclick" or "singleclick") (defaults to "default")
+        @type str (optional)
         """
         # step 1: set the style
         style = None
@@ -46,10 +49,9 @@
         if style is None:
             style = QStyleFactory.create(self.defaultStyleName)
 
-        if style is None:
-            QApplication.setStyle(EricProxyStyle())
-        else:
-            QApplication.setStyle(EricProxyStyle(style))
+        QApplication.setStyle(
+            EricProxyStyle(style=style, itemClickBehavior=itemClickBehavior)
+        )
 
         # step 2: set a style sheet
         ericApp().setStyleSheetFile(styleSheetFile)

eric ide

mercurial