feat: Default-Wallpaper-Fallback und neues Wallpaper
Greeter fällt auf mitgeliefertes Package-Wallpaper zurück, wenn kein Background konfiguriert ist. Wallpaper ersetzt durch Daniel Leone's "Snowy Mountain" (Unsplash License).
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 366 KiB |
@@ -25,6 +25,7 @@ LAST_USER_PATH = Path("/var/cache/moongreet/last-user")
|
||||
FAILLOCK_MAX_ATTEMPTS = 3
|
||||
PACKAGE_DATA = files("moongreet") / "data"
|
||||
DEFAULT_AVATAR_PATH = PACKAGE_DATA / "default-avatar.svg"
|
||||
DEFAULT_WALLPAPER_PATH = PACKAGE_DATA / "wallpaper.jpg"
|
||||
AVATAR_SIZE = 128
|
||||
|
||||
|
||||
@@ -69,9 +70,12 @@ class GreeterWindow(Gtk.ApplicationWindow):
|
||||
self.set_child(overlay)
|
||||
|
||||
# Background wallpaper (blurred and darkened)
|
||||
if self._config.background and self._config.background.exists():
|
||||
bg_path = self._config.background
|
||||
if not bg_path or not bg_path.exists():
|
||||
bg_path = Path(str(DEFAULT_WALLPAPER_PATH))
|
||||
if bg_path.exists():
|
||||
background = Gtk.Picture()
|
||||
background.set_filename(str(self._config.background))
|
||||
background.set_filename(str(bg_path))
|
||||
background.set_content_fit(Gtk.ContentFit.COVER)
|
||||
background.set_hexpand(True)
|
||||
background.set_vexpand(True)
|
||||
|
||||
Reference in New Issue
Block a user