提交 5c7c1f74 编写于 作者: H HinGwenWoong

show file list image count make the labelers more clear about the image situation

上级 fd7801c3
...@@ -180,7 +180,8 @@ class MainWindow(QMainWindow, WindowMixin): ...@@ -180,7 +180,8 @@ class MainWindow(QMainWindow, WindowMixin):
fileListContainer = QWidget() fileListContainer = QWidget()
fileListContainer.setLayout(filelistLayout) fileListContainer.setLayout(filelistLayout)
self.filedock = QDockWidget(getStr('fileList'), self) self.fileListName = getStr('fileList')
self.filedock = QDockWidget(self.fileListName, self)
self.filedock.setObjectName(getStr('files')) self.filedock.setObjectName(getStr('files'))
self.filedock.setWidget(fileListContainer) self.filedock.setWidget(fileListContainer)
self.addDockWidget(Qt.LeftDockWidgetArea, self.filedock) self.addDockWidget(Qt.LeftDockWidgetArea, self.filedock)
...@@ -1390,6 +1391,13 @@ class MainWindow(QMainWindow, WindowMixin): ...@@ -1390,6 +1391,13 @@ class MainWindow(QMainWindow, WindowMixin):
self.labelList.setCurrentItem(self.labelList.item(self.labelList.count() - 1)) self.labelList.setCurrentItem(self.labelList.item(self.labelList.count() - 1))
self.labelList.item(self.labelList.count() - 1).setSelected(True) self.labelList.item(self.labelList.count() - 1).setSelected(True)
# show file list image count
select_indexes = self.fileListWidget.selectedIndexes()
if len(select_indexes) > 0:
self.filedock.setWindowTitle(self.fileListName + f" ({select_indexes[0].row() + 1}"
f"/{self.fileListWidget.count()})")
self.canvas.setFocus(True) self.canvas.setFocus(True)
return True return True
return False return False
...@@ -1598,7 +1606,8 @@ class MainWindow(QMainWindow, WindowMixin): ...@@ -1598,7 +1606,8 @@ class MainWindow(QMainWindow, WindowMixin):
self.actions.rotateLeft.setEnabled(True) self.actions.rotateLeft.setEnabled(True)
self.actions.rotateRight.setEnabled(True) self.actions.rotateRight.setEnabled(True)
self.fileListWidget.setCurrentRow(0) # set list index to first
self.filedock.setWindowTitle(self.fileListName + f" (1/{self.fileListWidget.count()})") # show image count
def openPrevImg(self, _value=False): def openPrevImg(self, _value=False):
if len(self.mImgList) <= 0: if len(self.mImgList) <= 0:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册