This commit is contained in:
恍兮惚兮 2024-06-26 14:28:19 +08:00
parent 3f1ce52f05
commit 46f1c0d663

View File

@ -2414,10 +2414,12 @@ class pixwrapper(QWidget):
self.k = None self.k = None
self.pixmapi = 0 self.pixmapi = 0
self.pixview.setAlignment(Qt.AlignmentFlag.AlignCenter) self.pixview.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.current = None
def tolastnext(self, dx): def tolastnext(self, dx):
if len(self.pixmaps) == 0: if len(self.pixmaps) == 0:
return return
self.pixmapi = (self.pixmapi + dx) % len(self.pixmaps) self.pixmapi = (self.pixmapi + dx) % len(self.pixmaps)
self.visidx() self.visidx()
@ -2433,7 +2435,10 @@ class pixwrapper(QWidget):
def resizeEvent(self, e: QResizeEvent): def resizeEvent(self, e: QResizeEvent):
self.pixview.resize(e.size().width(), e.size().height()) self.pixview.resize(e.size().width(), e.size().height())
self.pathview.resize(e.size().width(), self.pathview.height()) self.pathview.resize(e.size().width(), self.pathview.height())
self.visidx() if self.current is None:
self.visidx()
else:
self.scalepix(self.current)
def visidx(self): def visidx(self):
if len(self.pixmaps) == 0: if len(self.pixmaps) == 0:
@ -2441,7 +2446,7 @@ class pixwrapper(QWidget):
return return
pixmap = getExeIcon(uid2gamepath[self.k], False, cache=True) pixmap = getExeIcon(uid2gamepath[self.k], False, cache=True)
pixmap.setDevicePixelRatio(self.devicePixelRatioF()) pixmap.setDevicePixelRatio(self.devicePixelRatioF())
self.pixview.setPixmap(self.scalepix(pixmap)) self.scalepix(pixmap)
else: else:
self.pixmapi = min(len(self.pixmaps) - 1, self.pixmapi) self.pixmapi = min(len(self.pixmaps) - 1, self.pixmapi)
pixmap_ = self.pixmaps[self.pixmapi] pixmap_ = self.pixmaps[self.pixmapi]
@ -2452,7 +2457,8 @@ class pixwrapper(QWidget):
self.pathview.setText(pixmap_) self.pathview.setText(pixmap_)
savehook_new_data[self.k]["currentvisimage"] = pixmap_ savehook_new_data[self.k]["currentvisimage"] = pixmap_
pixmap.setDevicePixelRatio(self.devicePixelRatioF()) pixmap.setDevicePixelRatio(self.devicePixelRatioF())
self.pixview.setPixmap(self.scalepix(pixmap)) self.current = pixmap
self.scalepix(pixmap)
def removecurrent(self): def removecurrent(self):
if len(self.pixmaps): if len(self.pixmaps):
@ -2482,7 +2488,7 @@ class pixwrapper(QWidget):
Qt.AspectRatioMode.KeepAspectRatio, Qt.AspectRatioMode.KeepAspectRatio,
Qt.TransformationMode.SmoothTransformation, Qt.TransformationMode.SmoothTransformation,
) )
return pix self.pixview.setPixmap(pix)
class dialog_savedgame_v3(QWidget): class dialog_savedgame_v3(QWidget):