src/eric7/EricWidgets/EricToolBarDialog.py

branch
eric7
changeset 10885
f6544d6924d0
parent 10869
3ea51d5cd462
child 11090
f5f5f5803935
--- 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