Skip to content

Add notification overlay widget

Maximiliano requested to merge msandova/libadwaita:adw-notifications into main

Fixes: #242 (closed)

Mockups: new, old

Quick summary:

3 new objects were added

AdwNotification: An Object which follows GNotification api, but without some of its extra api (message, icon). Stuff like title and button_label are not properties on purpose to not introduce more API.

AdwNotificationWidget: A private widget that represents an AdwNotification, this widget takes care of telling the overlay when it should be closed, either via timeout, X button, or (action) button press.

AdwNotificationOverlay: A widget that acts as an overlay for the main GtkWindow of the app, it displays AdwNotificationWidgets, the main method is void adw_notification_overlay_add_notification (AdwNotification *notification). This widget manages a queue for notifications. At the moment the queue size can grow indefinitely, and it would fall on the developer to check if the queue is too big to keep adding notifications.

TODO:

  • It crashes without error when adding notifications
  • Clear code a bit
  • Improve docs
  • Determine a transition style and duration for the notifications
  • Discard notification when the queue is full (3 notifications according to mockups). This might or might not be part of the initial implementation
Edited by Alice Mikhaylenko

Merge request reports