grid: store source pixmap for lossless re-scaling
set_pixmap now keeps the original pixmap alongside the scaled display copy. Used by live thumbnail resize in settings — re-scales from the source instead of the already-scaled pixmap, preventing quality degradation when changing sizes up and down.
This commit is contained in:
parent
d895c28608
commit
9592830e67
@ -74,6 +74,7 @@ class ThumbnailWidget(QWidget):
|
|||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.index = index
|
self.index = index
|
||||||
self._pixmap: QPixmap | None = None
|
self._pixmap: QPixmap | None = None
|
||||||
|
self._source_pixmap: QPixmap | None = None # original, for re-scaling on size change
|
||||||
self._selected = False
|
self._selected = False
|
||||||
self._multi_selected = False
|
self._multi_selected = False
|
||||||
self._bookmarked = False
|
self._bookmarked = False
|
||||||
@ -97,6 +98,7 @@ class ThumbnailWidget(QWidget):
|
|||||||
self.setMouseTracking(True)
|
self.setMouseTracking(True)
|
||||||
|
|
||||||
def set_pixmap(self, pixmap: QPixmap) -> None:
|
def set_pixmap(self, pixmap: QPixmap) -> None:
|
||||||
|
self._source_pixmap = pixmap
|
||||||
self._pixmap = pixmap.scaled(
|
self._pixmap = pixmap.scaled(
|
||||||
THUMB_SIZE - 4, THUMB_SIZE - 4,
|
THUMB_SIZE - 4, THUMB_SIZE - 4,
|
||||||
Qt.AspectRatioMode.KeepAspectRatio,
|
Qt.AspectRatioMode.KeepAspectRatio,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user