Store: show cached theme previews in grid and details panel
This commit is contained in:
+7
-2
@@ -1510,7 +1510,7 @@ class StoreDetailsPanel(QWidget):
|
|||||||
if lc is not None:
|
if lc is not None:
|
||||||
rid, system = lc
|
rid, system = lc
|
||||||
else:
|
else:
|
||||||
rid, system = covers.stable_key(item["name"]), "games"
|
rid, system = covers.stable_key(item["name"]), item.get("system") or "games"
|
||||||
self._set_cover(rid, system)
|
self._set_cover(rid, system)
|
||||||
|
|
||||||
def _set_cover(self, rid, system):
|
def _set_cover(self, rid, system):
|
||||||
@@ -2033,7 +2033,12 @@ class StorePage(QWidget):
|
|||||||
else:
|
else:
|
||||||
rid, system = covers.stable_key(it["name"]), it.get("system") or "games"
|
rid, system = covers.stable_key(it["name"]), it.get("system") or "games"
|
||||||
if not covers.is_scrapable(system):
|
if not covers.is_scrapable(system):
|
||||||
return # themes/DLC have no covers
|
# Themes/DLC aren't scraped, but a downloaded theme's preview is
|
||||||
|
# cached locally — show it when available.
|
||||||
|
p = covers.cover_path(rid, system)
|
||||||
|
if p.exists() and covers.file_is_image(p):
|
||||||
|
item.setIcon(QIcon(_fit_pixmap(QPixmap(str(p)), self.ICON_W, self.ICON_H)))
|
||||||
|
return
|
||||||
p = covers.cover_path(rid, system)
|
p = covers.cover_path(rid, system)
|
||||||
if p.exists() and covers.file_is_image(p):
|
if p.exists() and covers.file_is_image(p):
|
||||||
item.setIcon(QIcon(_fit_pixmap(QPixmap(str(p)), self.ICON_W, self.ICON_H)))
|
item.setIcon(QIcon(_fit_pixmap(QPixmap(str(p)), self.ICON_W, self.ICON_H)))
|
||||||
|
|||||||
Reference in New Issue
Block a user