[polari] roomStack: Move MessageInfoBar from appNotifications



commit f731106d611c3e863b1fd5390259612ab45c346c
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Feb 27 18:22:16 2022 +0100

    roomStack: Move MessageInfoBar from appNotifications
    
    It's not an app notification, and it's only used by subclasses
    in the RoomStack module.
    
    Part-of: <https://gitlab.gnome.org/GNOME/polari/-/merge_requests/250>

 src/appNotifications.js | 50 -----------------------------------------------
 src/roomStack.js        | 52 ++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 51 insertions(+), 51 deletions(-)
---
diff --git a/src/appNotifications.js b/src/appNotifications.js
index 9b40559c..4e9a3111 100644
--- a/src/appNotifications.js
+++ b/src/appNotifications.js
@@ -145,53 +145,3 @@ class CommandOutputQueue extends NotificationQueue {
         this.add_css_class('irc-feedback');
     }
 });
-
-export const MessageInfoBar = GObject.registerClass(
-class MessageInfoBar extends Gtk.InfoBar {
-    static [GObject.properties] = {
-        'title': GObject.ParamSpec.string(
-            'title', 'title', 'title',
-            GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT,
-            ''),
-        'subtitle': GObject.ParamSpec.string(
-            'subtitle', 'subtitle', 'subtitle',
-            GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT,
-            ''),
-    };
-
-    constructor(params) {
-        let defaultParams = {
-            show_close_button: true,
-            revealed: false,
-            valign: Gtk.Align.START,
-        };
-        super(Object.assign(defaultParams, params));
-
-        let box = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
-        this.add_child(box);
-
-        this._titleLabel = new Gtk.Label({
-            css_classes: ['heading'],
-            halign: Gtk.Align.START,
-            valign: Gtk.Align.CENTER,
-            wrap: true,
-        });
-        box.append(this._titleLabel);
-
-        this._subtitleLabel = new Gtk.Label({
-            halign: Gtk.Align.START,
-            valign: Gtk.Align.CENTER,
-            ellipsize: Pango.EllipsizeMode.END,
-        });
-        box.append(this._subtitleLabel);
-
-        this.bind_property('title',
-            this._titleLabel, 'label',
-            GObject.BindingFlags.SYNC_CREATE);
-        this.bind_property('subtitle',
-            this._subtitleLabel, 'label',
-            GObject.BindingFlags.SYNC_CREATE);
-
-        this.connect('response', () => (this.revealed = false));
-    }
-});
diff --git a/src/roomStack.js b/src/roomStack.js
index 667d9d13..ef3a5441 100644
--- a/src/roomStack.js
+++ b/src/roomStack.js
@@ -3,12 +3,12 @@ import Gio from 'gi://Gio';
 import GLib from 'gi://GLib';
 import GObject from 'gi://GObject';
 import Gtk from 'gi://Gtk';
+import Pango from 'gi://Pango';
 import Tp from 'gi://TelepathyGLib';
 
 import AccountsMonitor from './accountsMonitor.js';
 import ChatView from './chatView.js';
 import EntryArea from './entryArea.js';
-import { MessageInfoBar } from './appNotifications.js';
 import RoomManager from './roomManager.js';
 
 export default GObject.registerClass(
@@ -118,6 +118,56 @@ class RoomStack extends Gtk.Stack {
     }
 });
 
+export const MessageInfoBar = GObject.registerClass(
+class MessageInfoBar extends Gtk.InfoBar {
+    static [GObject.properties] = {
+        'title': GObject.ParamSpec.string(
+            'title', 'title', 'title',
+            GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT,
+            ''),
+        'subtitle': GObject.ParamSpec.string(
+            'subtitle', 'subtitle', 'subtitle',
+            GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT,
+            ''),
+    };
+
+    constructor(params) {
+        let defaultParams = {
+            show_close_button: true,
+            revealed: false,
+            valign: Gtk.Align.START,
+        };
+        super(Object.assign(defaultParams, params));
+
+        let box = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
+        this.add_child(box);
+
+        this._titleLabel = new Gtk.Label({
+            css_classes: ['heading'],
+            halign: Gtk.Align.START,
+            valign: Gtk.Align.CENTER,
+            wrap: true,
+        });
+        box.append(this._titleLabel);
+
+        this._subtitleLabel = new Gtk.Label({
+            halign: Gtk.Align.START,
+            valign: Gtk.Align.CENTER,
+            ellipsize: Pango.EllipsizeMode.END,
+        });
+        box.append(this._subtitleLabel);
+
+        this.bind_property('title',
+            this._titleLabel, 'label',
+            GObject.BindingFlags.SYNC_CREATE);
+        this.bind_property('subtitle',
+            this._subtitleLabel, 'label',
+            GObject.BindingFlags.SYNC_CREATE);
+
+        this.connect('response', () => (this.revealed = false));
+    }
+});
+
 const SavePasswordConfirmationBar = GObject.registerClass(
 class SavePasswordConfirmationBar extends MessageInfoBar {
     constructor(room) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]