✨ feat(dock, notifications): add NotificationHistoryPopup with hover-based reveal and revealer transition
This commit is contained in:
3 files changed
+244
-23
No files matched your search
@@ -98,6 +98,7 @@ class BatteryPopup(Window):
|
||||
transition_type=transition_type,
|
||||
transition_duration=300,
|
||||
child=self.content_box,
|
||||
reveal_child=False,
|
||||
)
|
||||
|
||||
self.add(self.revealer)
|
||||
@@ -321,8 +322,15 @@ class BatteryPopup(Window):
|
||||
"""Show the battery popup"""
|
||||
self.update_content()
|
||||
self.set_visible(True)
|
||||
self.revealer.reveal()
|
||||
self.show_all()
|
||||
# Use GLib.idle_add to ensure the window is shown before revealing
|
||||
GLib.idle_add(self._reveal_popup)
|
||||
|
||||
def _reveal_popup(self):
|
||||
"""Reveal the popup after window is shown"""
|
||||
self.revealer.set_reveal_child(True)
|
||||
self.grab_focus()
|
||||
return False # Don't repeat
|
||||
|
||||
def _get_popup_anchor(self, dock_position):
|
||||
"""Get popup anchor based on dock position"""
|
||||
@@ -375,7 +383,7 @@ class BatteryPopup(Window):
|
||||
|
||||
def hide_popup(self):
|
||||
"""Hide the battery popup"""
|
||||
self.revealer.unreveal()
|
||||
self.revealer.set_reveal_child(False)
|
||||
# Hide window after transition completes
|
||||
GLib.timeout_add(350, lambda: self.set_visible(False))
|
||||
|
||||
|
||||
Reference in new issue
Block a user