From 83ea818a0a5030141fb17878a576cefb001d9e9c Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Mon, 12 Feb 2024 10:16:36 +0100 Subject: [PATCH] messageTray: Drop createBanner() This removes the `createBanner()` method on `Notification` and `Source`. Since we want to use the same widget for the calendar and the banner, let's not allow to create custom widgets just for the banner. Part-of: --- js/ui/messageTray.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 48731367a..823b7b9ab 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -555,15 +555,6 @@ export const Notification = GObject.registerClass({ this.sound?.play(this.title); } - // Allow customizing the banner UI: - // the default implementation defers the creation to - // the source (which will create a NotificationBanner), - // so customization can be done by subclassing either - // Notification or Source - createBanner() { - return this.source.createBanner(this); - } - activate() { this.emit('activated'); @@ -664,10 +655,6 @@ export const Source = GObject.registerClass({ : PrivacyScope.USER; } - createBanner(notification) { - return new NotificationBanner(notification); - } - _onNotificationDestroy(notification) { let index = this.notifications.indexOf(notification); if (index < 0) @@ -1160,7 +1147,7 @@ export const MessageTray = GObject.registerClass({ this.idleMonitor.add_user_active_watch(this._onIdleMonitorBecameActive.bind(this)); } - this._banner = this._notification.createBanner(); + this._banner = new NotificationBanner(this._notification); this._banner.connectObject('done-displaying', this._escapeTray.bind(this), this); this._bannerBin.add_child(this._banner);