Fixed an issue in the tool bar dialog causing wrong left and up button states eventually leading to exceptions. eric7

Fri, 23 Aug 2024 12:32:14 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 23 Aug 2024 12:32:14 +0200
branch
eric7
changeset 10885
f6544d6924d0
parent 10884
2be906d60ffb
child 10886
e46fcabe7a3f

Fixed an issue in the tool bar dialog causing wrong left and up button states eventually leading to exceptions.

src/eric7/EricWidgets/EricToolBarDialog.py file | annotate | diff | comparison | revisions
--- a/src/eric7/EricWidgets/EricToolBarDialog.py	Sat Aug 03 11:01:25 2024 +0200
+++ b/src/eric7/EricWidgets/EricToolBarDialog.py	Fri Aug 23 12:32:14 2024 +0200
@@ -258,8 +258,10 @@
 
         row = self.toolbarActionsList.currentRow()
         self.upButton.setEnabled(row > 0)
-        self.downButton.setEnabled(row < self.toolbarActionsList.count() - 1)
-        self.leftButton.setEnabled(self.toolbarActionsList.count() > 0)
+        self.downButton.setEnabled(
+            row >= 0 and row < self.toolbarActionsList.count() - 1
+        )
+        self.leftButton.setEnabled(self.toolbarActionsList.count() > 0 and row >= 0)
         rightEnable = (
             self.actionsTree.currentItem().parent() is not None
             or self.actionsTree.currentItem().text(0) == self.__separatorText

eric ide

mercurial