--- a/src/eric7/EricWidgets/EricSideBar.py Thu Aug 25 19:35:37 2022 +0200 +++ b/src/eric7/EricWidgets/EricSideBar.py Fri Aug 26 14:49:15 2022 +0200 @@ -82,7 +82,8 @@ self.__iconBar.currentChanged.connect(self.__stackedWidget.setCurrentIndex) self.__iconBar.currentChanged.connect(self.__currentIconChanged) - self.__iconBar.currentClicked.connect(self.__currentIconClicked) + self.__iconBar.currentClicked.connect(self.__shrinkOrExpandIt) + self.__iconBar.emptyClicked.connect(self.__shrinkOrExpandIt) def __shrinkIt(self): """ @@ -120,6 +121,16 @@ self.setMinimumWidth(minSize) self.setMaximumWidth(self.__maxSize) + @pyqtSlot() + def __shrinkOrExpandIt(self): + """ + Private slot to shrink or expand the widget stack. + """ + if self.isMinimized(): + self.__expandIt() + else: + self.__shrinkIt() + def isMinimized(self): """ Public method to check the minimized state. @@ -139,19 +150,6 @@ if self.isMinimized(): self.__expandIt() - @pyqtSlot(int) - def __currentIconClicked(self, index): - """ - Private slot to handle a click of the current icon. - - @param index index of the clicked icon - @type int - """ - if self.isMinimized(): - self.__expandIt() - else: - self.__shrinkIt() - def addTab(self, widget, icon, label=None): """ Public method to add a tab to the sidebar.