mirror of
https://git.srhtnin.garden/sarah/SaraSuite.git
synced 2026-10-15 02:33:17 +02:00
Program icons at 128px, no frame
This commit is contained in:
1 parent
e8c524531e
commit
d9da8438c2
8 files changed
+128
-71
No files matched your search
@@ -129,6 +129,22 @@ class Program:
|
||||
def AppDir(self) -> Path:
|
||||
return self.ProgramDir / "App"
|
||||
|
||||
@property
|
||||
def IconPath(self) -> Optional[Path]:
|
||||
"""The installed copy's own icon if it's there (always current; the
|
||||
Icon= line of the program's desktop entry template says where), otherwise
|
||||
the copy bundled next to the manifest (Programs/<Name>/Icon.png), so the
|
||||
card has an icon before installing too."""
|
||||
for Template in self.Templates:
|
||||
if Template.Target.endswith(".desktop"):
|
||||
for Line in (self.Folder / "Templates" / Template.Source).read_text().splitlines():
|
||||
if Line.startswith("Icon="):
|
||||
Installed = Path(Render(Line.removeprefix("Icon="), self.Context()))
|
||||
if Installed.is_file():
|
||||
return Installed
|
||||
Bundled = self.Folder / "Icon.png"
|
||||
return Bundled if Bundled.is_file() else None
|
||||
|
||||
@property
|
||||
def ConfigDir(self) -> Path:
|
||||
return SharedConfigDir / self.Name
|
||||
|
||||
Reference in new issue
Block a user