messages: Move message widgets from calendar.js to messageList.js

The widgets `NotificationMessage` and `NotificationSection` in `calendar.js`
aren't used only by the calendar.

Move the two widget to messageList.js since once we add by-source grouping for
messages (which will happen in a future commit) we need a much tighter
coupling between them and the rest of the MessageList. In future the
`NotificationSection` will need to be removed to make expanding of
groups work.

This also removes a circular import of files: `calender.js` imports
`messageTray.js` and it imports `calender.js`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3429>
This commit is contained in:
Julian Sparber
2024-05-10 10:05:45 +02:00
parent e77b716793
commit 64aadeece3
3 changed files with 146 additions and 148 deletions

View File

@ -6,7 +6,6 @@ import Meta from 'gi://Meta';
import Shell from 'gi://Shell';
import St from 'gi://St';
import * as Calendar from './calendar.js';
import * as GnomeSession from '../misc/gnomeSession.js';
import * as Layout from './layout.js';
import * as Main from './main.js';
@ -1119,7 +1118,7 @@ export const MessageTray = GObject.registerClass({
this.idleMonitor.add_user_active_watch(this._onIdleMonitorBecameActive.bind(this));
}
this._banner = new Calendar.NotificationMessage(this._notification);
this._banner = new MessageList.NotificationMessage(this._notification);
this._banner.can_focus = false;
this._banner._header.expandButton.visible = false;
this._banner.add_style_class_name('notification-banner');