[polari] mainWindow: Remove command output queue
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] mainWindow: Remove command output queue
- Date: Mon, 28 Feb 2022 10:53:02 +0000 (UTC)
commit 45a2f917981252df0ffc1a79c579695eddb665cf
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Feb 16 01:29:21 2022 +0100
mainWindow: Remove command output queue
It is no longer used.
Part-of: <https://gitlab.gnome.org/GNOME/polari/-/merge_requests/247>
src/appNotifications.js | 61 -------------------------------------------------
src/mainWindow.js | 16 -------------
2 files changed, 77 deletions(-)
---
diff --git a/src/appNotifications.js b/src/appNotifications.js
index f9a829c0..6e591826 100644
--- a/src/appNotifications.js
+++ b/src/appNotifications.js
@@ -4,7 +4,6 @@ import Gtk from 'gi://Gtk';
import Pango from 'gi://Pango';
const TIMEOUT = 7;
-const COMMAND_OUTPUT_REVEAL_TIME = 3;
const AppNotification = GObject.registerClass(
class AppNotification extends Gtk.Revealer {
@@ -98,66 +97,6 @@ class UndoNotification extends MessageNotification {
}
});
-const CommandOutputNotification = GObject.registerClass(
-class CommandOutputNotification extends AppNotification {
- static [GObject.GTypeFlags] = GObject.TypeFlags.ABSTRACT;
-
- constructor() {
- super();
-
- this.transition_type = Gtk.RevealerTransitionType.SLIDE_UP;
- GLib.timeout_add_seconds(
- GLib.PRIORITY_DEFAULT,
- COMMAND_OUTPUT_REVEAL_TIME,
- this.close.bind(this));
- }
-});
-
-export const SimpleOutput = GObject.registerClass(
-class SimpleOutput extends CommandOutputNotification {
- constructor(text) {
- super();
-
- let label = new Gtk.Label({
- label: text,
- vexpand: true,
- wrap: true,
- });
- this.set_child(label);
- }
-});
-
-export const GridOutput = GObject.registerClass(
-class GridOutput extends CommandOutputNotification {
- constructor(header, items) {
- super();
-
- let numItems = items.length;
- let numCols = Math.min(numItems, 4);
- let numRows = Math.floor(numItems / numCols) + numItems % numCols;
-
- let grid = new Gtk.Grid({
- column_homogeneous: true,
- row_spacing: 6,
- column_spacing: 18,
- });
- grid.attach(new Gtk.Label({ label: header }), 0, 0, numCols, 1);
-
- let row = 1;
- for (let i = 0; i < numRows; i++) {
- for (let j = 0; j < numCols; j++) {
- let item = items[i + j * numRows];
- if (!item)
- continue;
- let w = new Gtk.Label({ label: item });
- grid.attach(w, j, row, 1, 1);
- }
- row++;
- }
- this.set_child(grid);
- }
-});
-
export const NotificationQueue = GObject.registerClass(
class NotificationQueue extends Gtk.Frame {
constructor() {
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 3651034b..be9b6715 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -151,10 +151,8 @@ class MainWindow extends Gtk.ApplicationWindow {
this._userListPopover.set_parent(this._showUserListButton);
this._notificationQueue = new AppNotifications.NotificationQueue();
- this._commandOutputQueue = new AppNotifications.CommandOutputQueue();
this._overlay.add_overlay(this._notificationQueue);
- this._overlay.add_overlay(this._commandOutputQueue);
const app = this.application;
if (app.isTestInstance)
@@ -165,13 +163,6 @@ class MainWindow extends Gtk.ApplicationWindow {
this._roomStack.connect('notify::view-height',
() => this.notify('view-height'));
- // command output notifications should not pop up over
- // the input area, but appear to emerge from it, so
- // set up an appropriate margin
- this._roomStack.bind_property('entry-area-height',
- this._commandOutputQueue, 'margin-bottom',
- GObject.BindingFlags.SYNC_CREATE);
-
// Make sure user-list button is at least as wide as icon buttons
this._showUserListButton.layout_manager = new HeaderBarButtonLayout();
@@ -252,13 +243,6 @@ class MainWindow extends Gtk.ApplicationWindow {
this._notificationQueue.addNotification(n);
}
- /**
- * @param {AppNotification} n - a notification
- */
- queueCommandOutput(n) {
- this._commandOutputQueue.addNotification(n);
- }
-
_onAccountsReachableChanged() {
let accounts = this._accountsMonitor.visibleAccounts;
this._offlineInfoBar.revealed =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]