feat: fade-in animation for panel and wallpaper windows
CSS opacity transition (350ms ease-in) triggered via adding a 'visible' class after the window is mapped.
This commit is contained in:
parent
fe6421c582
commit
4a2bbb3e98
@ -4,7 +4,7 @@
|
||||
# Maintainer: Dominik Kressler
|
||||
|
||||
pkgname=moonlock-git
|
||||
pkgver=0.2.0.r0.g7cee4f4
|
||||
pkgver=0.3.0.r1.gfe6421c
|
||||
pkgrel=1
|
||||
pkgdesc="A secure Wayland lockscreen with GTK4, PAM and fingerprint support"
|
||||
arch=('any')
|
||||
|
||||
@ -53,6 +53,9 @@ class LockscreenWindow(Gtk.ApplicationWindow):
|
||||
self._setup_keyboard()
|
||||
self._password_entry.grab_focus()
|
||||
|
||||
# Fade-in after window is mapped
|
||||
self.connect("map", self._on_map_fade_in)
|
||||
|
||||
# Start fingerprint listener if available (only once across shared instances)
|
||||
if self._fp_available and not self._fp_listener._running:
|
||||
self._fp_listener.start(
|
||||
@ -61,6 +64,10 @@ class LockscreenWindow(Gtk.ApplicationWindow):
|
||||
on_failure=self._on_fingerprint_failure,
|
||||
)
|
||||
|
||||
def _on_map_fade_in(self, widget: Gtk.Widget) -> None:
|
||||
"""Trigger fade-in once the window is visible."""
|
||||
GLib.idle_add(lambda: self.add_css_class("visible") or GLib.SOURCE_REMOVE)
|
||||
|
||||
def _build_ui(self) -> None:
|
||||
"""Build the lockscreen layout."""
|
||||
# Main overlay for background + centered content
|
||||
|
||||
@ -6,6 +6,12 @@ window.lockscreen {
|
||||
background-color: #1a1a2e;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
opacity: 0;
|
||||
transition: opacity 350ms ease-in;
|
||||
}
|
||||
|
||||
window.lockscreen.visible {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Central login area */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user