better use of icons
authorNiki Roo <niki@nikiroo.be>
Sat, 3 May 2025 13:14:19 +0000 (15:14 +0200)
committerNiki Roo <niki@nikiroo.be>
Sat, 3 May 2025 13:14:19 +0000 (15:14 +0200)
gamiki/game.py
gamiki/qt/tiles.py

index 541d7a327b89bf9a3f2f15faf1b286a16eab6eae..ea442fb6cd049a0bbd33cec8f44ada8d7ee5e082 100644 (file)
@@ -57,9 +57,11 @@ class Game(dict):
     def _init_icons(self):
         self.icon = self._read_icon()
         self.icons = { "main": self.icon }
-        for key in [ "square", "icon", "vertical", "banner", "logo" ]:
+        for key in [ "square", "vertical", "banner", "logo", "icon" ]:
             icon = self._read_icon("-" + key)
             if (icon): self.icons[key] = icon
+        if (not self.icon and self.icons):
+            self.icon = self.icons.get(next(iter(self.icons)))
     
     def _read_info(self):
         file = self.dir.joinpath("gameinfo.txt")
index a61497edd9915463b84e97c450dc7f19c2b2bf7e..60fd5d248c12089428808e71c3715be32a6db543 100755 (executable)
@@ -26,7 +26,7 @@ class ListItem(QWidget):
         self.game = game
         self.coverSize = coverSize
         
-        if (self.game.icon):
+        if (self.game.get_icon(cover)):
             self.imagePath = self.game.get_icon(cover).as_posix()
         else:
             self.imagePath = ""