messageList: Make notification groups expandable/collapsible

This implements the new expand/collapse feature for notification groups
according to the new notification designs [1].

[1] 9e2bed6f37/notifications-calendar/notifications-grouping.png

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3012>
This commit is contained in:
Julian Sparber
2025-02-03 16:53:45 +01:00
committed by Marge Bot
parent dae4179b3d
commit 47de83a922
6 changed files with 593 additions and 8 deletions

View File

@ -920,6 +920,18 @@ class DateMenuButton extends PanelMenu.Button {
this._messageList = new Calendar.CalendarMessageList();
hbox.add_child(this._messageList);
// Collapse notification groups when the user clicks outside of the expanded group
this.menu.actor.connectObject(
'captured-event::button', (_, event) => {
return this._messageList.maybeCollapseMessageGroupForEvent(event);
},
'captured-event::touch', (_, event) => {
return this._messageList.maybeCollapseMessageGroupForEvent(event);
},
'captured-event::key', (_, event) => {
return this._messageList.maybeCollapseMessageGroupForEvent(event);
});
// Fill up the second column
const boxLayout = new CalendarColumnLayout([this._calendar, this._date]);
const vbox = new St.Widget({