src/eric7/EricWidgets/EricIconBar.py

branch
eric7
changeset 9298
8863f3e970a2
parent 9221
bf71ee032bb4
child 9413
80c06d472826
diff -r c1c808e65211 -r 8863f3e970a2 src/eric7/EricWidgets/EricIconBar.py
--- a/src/eric7/EricWidgets/EricIconBar.py	Thu Aug 25 19:35:37 2022 +0200
+++ b/src/eric7/EricWidgets/EricIconBar.py	Fri Aug 26 14:49:15 2022 +0200
@@ -28,6 +28,8 @@
         index
     @signal currentClicked(index) emitted to indicate, that the current icon
         was clicked
+    @signal emptyClicked() emitted to indicate a mouse click on the empty part
+        of the icon bar
     """
 
     BarSizes = {
@@ -53,6 +55,7 @@
 
     currentChanged = pyqtSignal(int)
     currentClicked = pyqtSignal(int)
+    emptyClicked = pyqtSignal()
 
     def __init__(
         self, orientation=Qt.Orientation.Horizontal, barSize=DefaultBarSize, parent=None
@@ -505,3 +508,12 @@
                 iconLabel = self.__layout.itemAt(index)
                 if iconLabel:
                     iconLabel.widget().show()
+
+    def mouseReleaseEvent(self, evt):
+        """
+        Protected method to handle a click on the empty space.
+
+        @param evt reference to the mouse event
+        @type QMouseEvent
+        """
+        self.emptyClicked.emit()

eric ide

mercurial