import gnome-shell-extensions-3.32.1-27.el8
This commit is contained in:
parent
e055812096
commit
a6b32bc93b
@ -1,7 +1,7 @@
|
||||
From ed28c7abd7c324dc6071ff96309854b1f5d48761 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
||||
Date: Wed, 20 May 2015 17:44:50 +0200
|
||||
Subject: [PATCH 1/9] Add top-icons extension
|
||||
Subject: [PATCH 01/10] Add top-icons extension
|
||||
|
||||
---
|
||||
extensions/top-icons/extension.js | 96 +++++++++++++++++++++++++++
|
||||
@ -164,13 +164,13 @@ index b987f2d4..6050c32f 100644
|
||||
]
|
||||
|
||||
--
|
||||
2.32.0
|
||||
2.33.1
|
||||
|
||||
|
||||
From b99f1a2ead84c4fe494a387a032715f2973fbfa7 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
||||
Date: Wed, 20 May 2015 18:05:41 +0200
|
||||
Subject: [PATCH 2/9] Add dash-to-dock extension
|
||||
Subject: [PATCH 02/10] Add dash-to-dock extension
|
||||
|
||||
---
|
||||
extensions/dash-to-dock/Settings.ui | 3335 +++++++++++++++++
|
||||
@ -13413,13 +13413,13 @@ index 6050c32f..2909135a 100644
|
||||
'top-icons',
|
||||
'user-theme'
|
||||
--
|
||||
2.32.0
|
||||
2.33.1
|
||||
|
||||
|
||||
From 9ffe67c4d25f34fa6c3af5ee4ddbd0be3018ef14 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
||||
Date: Wed, 20 May 2015 18:55:47 +0200
|
||||
Subject: [PATCH 3/9] Add panel-favorites extension
|
||||
Subject: [PATCH 03/10] Add panel-favorites extension
|
||||
|
||||
---
|
||||
extensions/panel-favorites/extension.js | 267 ++++++++++++++++++++
|
||||
@ -13766,13 +13766,13 @@ index 2909135a..e8e00dce 100644
|
||||
'user-theme'
|
||||
]
|
||||
--
|
||||
2.32.0
|
||||
2.33.1
|
||||
|
||||
|
||||
From 4bd1716e559af83795eec5b02025798b02c09fa4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
||||
Date: Fri, 4 Mar 2016 17:07:21 +0100
|
||||
Subject: [PATCH 4/9] Add updates-dialog extension
|
||||
Subject: [PATCH 04/10] Add updates-dialog extension
|
||||
|
||||
---
|
||||
extensions/updates-dialog/extension.js | 503 ++++++++++++++++++
|
||||
@ -14396,13 +14396,13 @@ index 9c1438ac..55f0e9aa 100644
|
||||
extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml
|
||||
extensions/window-list/extension.js
|
||||
--
|
||||
2.32.0
|
||||
2.33.1
|
||||
|
||||
|
||||
From 0ba4b86fa5f73bccd3ab1984d9deef0d39f656c6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
||||
Date: Thu, 1 Jun 2017 23:57:14 +0200
|
||||
Subject: [PATCH 5/9] Add no-hot-corner extension
|
||||
Subject: [PATCH 05/10] Add no-hot-corner extension
|
||||
|
||||
---
|
||||
extensions/no-hot-corner/extension.js | 31 +++++++++++++++++++++++
|
||||
@ -14499,13 +14499,13 @@ index d129e6cd..6f27f460 100644
|
||||
'top-icons',
|
||||
'updates-dialog',
|
||||
--
|
||||
2.32.0
|
||||
2.33.1
|
||||
|
||||
|
||||
From f56b4374904cdfd8e1790dc3cf5080b60f30ebea Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
||||
Date: Tue, 26 Mar 2019 19:44:43 +0100
|
||||
Subject: [PATCH 6/9] Add window-grouper extension
|
||||
Subject: [PATCH 06/10] Add window-grouper extension
|
||||
|
||||
---
|
||||
extensions/window-grouper/extension.js | 109 ++++++++++
|
||||
@ -14903,13 +14903,13 @@ index 6f27f460..4b9d138c 100644
|
||||
|
||||
enabled_extensions = get_option('enable_extensions')
|
||||
--
|
||||
2.32.0
|
||||
2.33.1
|
||||
|
||||
|
||||
From 25c4999ff6adf19a32bab2a4d6cccae42520563b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
||||
Date: Tue, 26 Mar 2019 21:32:09 +0100
|
||||
Subject: [PATCH 7/9] Add disable-screenshield extension
|
||||
Subject: [PATCH 07/10] Add disable-screenshield extension
|
||||
|
||||
---
|
||||
extensions/disable-screenshield/extension.js | 27 +++++++++++++++++++
|
||||
@ -15002,13 +15002,13 @@ index 4b9d138c..cf855a01 100644
|
||||
'no-hot-corner',
|
||||
'panel-favorites',
|
||||
--
|
||||
2.32.0
|
||||
2.33.1
|
||||
|
||||
|
||||
From 59604979f6ba48b7ff8d1616ab9df739dcf46a20 Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Soriano <csoriano@gnome.org>
|
||||
Date: Mon, 13 Aug 2018 17:28:41 +0200
|
||||
Subject: [PATCH 8/9] Add desktop icons extension
|
||||
Subject: [PATCH 08/10] Add desktop icons extension
|
||||
|
||||
---
|
||||
.../desktop-icons/createFolderDialog.js | 164 ++++
|
||||
@ -26738,13 +26738,13 @@ index 74a95f8a..fa5ba9b8 100644
|
||||
#~ msgstr "Dock 的位置"
|
||||
|
||||
--
|
||||
2.32.0
|
||||
2.33.1
|
||||
|
||||
|
||||
From dc47faaf827011e5dd7a53f9007ea618c6e88203 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
||||
Date: Fri, 8 Oct 2021 19:36:18 +0200
|
||||
Subject: [PATCH 9/9] Add dash-to-panel
|
||||
Subject: [PATCH 09/10] Add dash-to-panel
|
||||
|
||||
---
|
||||
extensions/dash-to-panel/COPYING | 341 +
|
||||
@ -70770,5 +70770,662 @@ index fa5ba9b8..015d85a4 100644
|
||||
#~ msgstr "退出應用程式"
|
||||
|
||||
--
|
||||
2.32.0
|
||||
2.33.1
|
||||
|
||||
|
||||
From e8facafa1d16fc62a01c02bcee9e34a388f81572 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
||||
Date: Thu, 2 Dec 2021 19:39:50 +0100
|
||||
Subject: [PATCH 10/10] Add classification-banner
|
||||
|
||||
---
|
||||
extensions/classification-banner/extension.js | 170 ++++++++
|
||||
extensions/classification-banner/meson.build | 8 +
|
||||
.../classification-banner/metadata.json.in | 11 +
|
||||
...tensions.classification-banner.gschema.xml | 29 ++
|
||||
extensions/classification-banner/prefs.js | 363 ++++++++++++++++++
|
||||
.../classification-banner/stylesheet.css | 3 +
|
||||
meson.build | 1 +
|
||||
7 files changed, 585 insertions(+)
|
||||
create mode 100644 extensions/classification-banner/extension.js
|
||||
create mode 100644 extensions/classification-banner/meson.build
|
||||
create mode 100644 extensions/classification-banner/metadata.json.in
|
||||
create mode 100644 extensions/classification-banner/org.gnome.shell.extensions.classification-banner.gschema.xml
|
||||
create mode 100644 extensions/classification-banner/prefs.js
|
||||
create mode 100644 extensions/classification-banner/stylesheet.css
|
||||
|
||||
diff --git a/extensions/classification-banner/extension.js b/extensions/classification-banner/extension.js
|
||||
new file mode 100644
|
||||
index 00000000..6c2fe007
|
||||
--- /dev/null
|
||||
+++ b/extensions/classification-banner/extension.js
|
||||
@@ -0,0 +1,170 @@
|
||||
+/* extension.js
|
||||
+ *
|
||||
+ * This program is free software: you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation, either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ *
|
||||
+ * SPDX-License-Identifier: GPL-2.0-or-later
|
||||
+ */
|
||||
+
|
||||
+/* exported init */
|
||||
+
|
||||
+const { Clutter, Gio, GLib, GObject, St } = imports.gi;
|
||||
+
|
||||
+const ExtensionUtils = imports.misc.extensionUtils;
|
||||
+const Layout = imports.ui.layout;
|
||||
+const Main = imports.ui.main;
|
||||
+
|
||||
+const ClassificationBanner = GObject.registerClass(
|
||||
+class ClassificationBanner extends Clutter.Actor {
|
||||
+ _init(index) {
|
||||
+ super._init({
|
||||
+ layout_manager: new Clutter.BinLayout(),
|
||||
+ constraints: new Layout.MonitorConstraint({
|
||||
+ work_area: true,
|
||||
+ index,
|
||||
+ }),
|
||||
+ });
|
||||
+
|
||||
+ this._settings = ExtensionUtils.getSettings();
|
||||
+ this.connect('destroy', () => {
|
||||
+ if (this._settings)
|
||||
+ this._settings.run_dispose();
|
||||
+ this._settings = null;
|
||||
+ });
|
||||
+
|
||||
+ this._topBanner = new St.BoxLayout({
|
||||
+ style_class: 'classification-banner',
|
||||
+ x_expand: true,
|
||||
+ y_expand: true,
|
||||
+ y_align: Clutter.ActorAlign.START,
|
||||
+ });
|
||||
+ this.add_child(this._topBanner);
|
||||
+ this._settings.bind('top-banner',
|
||||
+ this._topBanner, 'visible',
|
||||
+ Gio.SettingsBindFlags.GET);
|
||||
+
|
||||
+ this._bottomBanner = new St.BoxLayout({
|
||||
+ style_class: 'classification-banner',
|
||||
+ x_expand: true,
|
||||
+ y_expand: true,
|
||||
+ y_align: Clutter.ActorAlign.END,
|
||||
+ });
|
||||
+ this.add_child(this._bottomBanner);
|
||||
+ this._settings.bind('bottom-banner',
|
||||
+ this._bottomBanner, 'visible',
|
||||
+ Gio.SettingsBindFlags.GET);
|
||||
+
|
||||
+ for (const banner of [this._topBanner, this._bottomBanner]) {
|
||||
+ const label = new St.Label({
|
||||
+ style_class: 'classification-message',
|
||||
+ x_align: Clutter.ActorAlign.CENTER,
|
||||
+ x_expand: true,
|
||||
+ });
|
||||
+ banner.add_child(label);
|
||||
+
|
||||
+ this._settings.bind('message',
|
||||
+ label, 'text',
|
||||
+ Gio.SettingsBindFlags.GET);
|
||||
+ }
|
||||
+
|
||||
+ const hostLabel = new St.Label({
|
||||
+ style_class: 'classification-system-info',
|
||||
+ text: GLib.get_host_name(),
|
||||
+ });
|
||||
+ this._topBanner.insert_child_at_index(hostLabel, 0);
|
||||
+ this._settings.bind('system-info',
|
||||
+ hostLabel, 'visible',
|
||||
+ Gio.SettingsBindFlags.GET);
|
||||
+
|
||||
+ const userLabel = new St.Label({
|
||||
+ style_class: 'classification-system-info',
|
||||
+ text: GLib.get_user_name(),
|
||||
+ });
|
||||
+ this._topBanner.add_child(userLabel);
|
||||
+ this._settings.bind('system-info',
|
||||
+ userLabel, 'visible',
|
||||
+ Gio.SettingsBindFlags.GET);
|
||||
+
|
||||
+ this._settings.connect('changed::color',
|
||||
+ () => this._updateStyles());
|
||||
+ this._settings.connect('changed::background-color',
|
||||
+ () => this._updateStyles());
|
||||
+ this._updateStyles();
|
||||
+ }
|
||||
+
|
||||
+ _getColorSetting(key) {
|
||||
+ const str = this._settings.get_string(key);
|
||||
+ const [valid, color] = Clutter.Color.from_string(str);
|
||||
+ if (!valid)
|
||||
+ return '';
|
||||
+ const { red, green, blue, alpha } = color;
|
||||
+ return `${key}: rgba(${red},${green},${blue},${alpha / 255});`;
|
||||
+ }
|
||||
+
|
||||
+ _updateStyles() {
|
||||
+ const bgStyle = this._getColorSetting('background-color');
|
||||
+ const fgStyle = this._getColorSetting('color');
|
||||
+ const style = `${bgStyle}${fgStyle}`;
|
||||
+ this._topBanner.set({ style });
|
||||
+ this._bottomBanner.set({ style });
|
||||
+ }
|
||||
+});
|
||||
+
|
||||
+class Extension {
|
||||
+ constructor() {
|
||||
+ this._banners = [];
|
||||
+ }
|
||||
+
|
||||
+ _updateMonitors() {
|
||||
+ const { monitors, panelBox, primaryIndex } = Main.layoutManager;
|
||||
+ if (monitors.length !== this._banners.length) {
|
||||
+ this._clearBanners();
|
||||
+
|
||||
+ for (let i = 0; i < monitors.length; i++) {
|
||||
+ const banner = new ClassificationBanner(i);
|
||||
+ Main.uiGroup.add_child(banner);
|
||||
+ this._banners.push(banner);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ const primaryBanner = this._banners[primaryIndex];
|
||||
+ if (primaryBanner)
|
||||
+ Main.uiGroup.set_child_below_sibling(primaryBanner, panelBox);
|
||||
+ }
|
||||
+
|
||||
+ _clearBanners() {
|
||||
+ this._banners.forEach(b => b.destroy());
|
||||
+ this._banners = [];
|
||||
+ }
|
||||
+
|
||||
+ enable() {
|
||||
+ this._monitorsChangedId = Main.layoutManager.connect('monitors-changed',
|
||||
+ () => this._updateMonitors());
|
||||
+ this._updateMonitors();
|
||||
+ }
|
||||
+
|
||||
+ disable() {
|
||||
+ if (this._monitorsChangedId) {
|
||||
+ Main.layoutManager.disconnect(this._monitorsChangedId);
|
||||
+ delete this._monitorsChangedId;
|
||||
+ }
|
||||
+ this._clearBanners();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * @returns {Extension} - the extension's state object
|
||||
+ */
|
||||
+function init() {
|
||||
+ return new Extension();
|
||||
+}
|
||||
diff --git a/extensions/classification-banner/meson.build b/extensions/classification-banner/meson.build
|
||||
new file mode 100644
|
||||
index 00000000..c55a7830
|
||||
--- /dev/null
|
||||
+++ b/extensions/classification-banner/meson.build
|
||||
@@ -0,0 +1,8 @@
|
||||
+extension_data += configure_file(
|
||||
+ input: metadata_name + '.in',
|
||||
+ output: metadata_name,
|
||||
+ configuration: metadata_conf
|
||||
+)
|
||||
+
|
||||
+extension_sources += files('prefs.js')
|
||||
+extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml')
|
||||
diff --git a/extensions/classification-banner/metadata.json.in b/extensions/classification-banner/metadata.json.in
|
||||
new file mode 100644
|
||||
index 00000000..1ec884f8
|
||||
--- /dev/null
|
||||
+++ b/extensions/classification-banner/metadata.json.in
|
||||
@@ -0,0 +1,11 @@
|
||||
+{
|
||||
+"extension-id": "@extension_id@",
|
||||
+"uuid": "@uuid@",
|
||||
+"settings-schema": "@gschemaname@",
|
||||
+"gettext-domain": "@gettext_domain@",
|
||||
+"name": "Classification Banner",
|
||||
+"description": "Display classification level banner",
|
||||
+"shell-version": [ "@shell_current@" ],
|
||||
+"session-modes": [ "gdm", "lock-screen", "unlock-dialog", "user" ],
|
||||
+"url": "@url@"
|
||||
+}
|
||||
diff --git a/extensions/classification-banner/org.gnome.shell.extensions.classification-banner.gschema.xml b/extensions/classification-banner/org.gnome.shell.extensions.classification-banner.gschema.xml
|
||||
new file mode 100644
|
||||
index 00000000..0314ef60
|
||||
--- /dev/null
|
||||
+++ b/extensions/classification-banner/org.gnome.shell.extensions.classification-banner.gschema.xml
|
||||
@@ -0,0 +1,29 @@
|
||||
+<schemalist gettext-domain="gnome-shell-extensions">
|
||||
+ <schema id="org.gnome.shell.extensions.classification-banner"
|
||||
+ path="/org/gnome/shell/extensions/classification-banner/">
|
||||
+ <key name="top-banner" type="b">
|
||||
+ <default>true</default>
|
||||
+ <summary>Show a banner at the top</summary>
|
||||
+ </key>
|
||||
+ <key name="bottom-banner" type="b">
|
||||
+ <default>true</default>
|
||||
+ <summary>Show a banner at the bottom</summary>
|
||||
+ </key>
|
||||
+ <key name="message" type="s">
|
||||
+ <default>"UNCLASSIFIED"</default>
|
||||
+ <summary>classification message</summary>
|
||||
+ </key>
|
||||
+ <key name="color" type="s">
|
||||
+ <default>"#fff"</default>
|
||||
+ <summary>text color</summary>
|
||||
+ </key>
|
||||
+ <key name="background-color" type="s">
|
||||
+ <default>"rgba(0,122,51,0.75)"</default>
|
||||
+ <summary>background color</summary>
|
||||
+ </key>
|
||||
+ <key name="system-info" type="b">
|
||||
+ <default>false</default>
|
||||
+ <summary>Include system info in top banner</summary>
|
||||
+ </key>
|
||||
+ </schema>
|
||||
+</schemalist>
|
||||
diff --git a/extensions/classification-banner/prefs.js b/extensions/classification-banner/prefs.js
|
||||
new file mode 100644
|
||||
index 00000000..607d4002
|
||||
--- /dev/null
|
||||
+++ b/extensions/classification-banner/prefs.js
|
||||
@@ -0,0 +1,363 @@
|
||||
+/* exported init buildPrefsWidget */
|
||||
+const { Gdk, Gio, GObject, Gtk } = imports.gi;
|
||||
+
|
||||
+const ExtensionUtils = imports.misc.extensionUtils;
|
||||
+const Gettext = imports.gettext.domain('gnome-shell-extensions');
|
||||
+const _ = Gettext.gettext;
|
||||
+
|
||||
+let settings = null;
|
||||
+
|
||||
+var PreferencesGroup = GObject.registerClass(
|
||||
+class PreferencesGroup extends Gtk.ListBox {
|
||||
+ _init(params) {
|
||||
+ super._init({
|
||||
+ ...params,
|
||||
+ selection_mode: Gtk.SelectionMode.NONE,
|
||||
+ });
|
||||
+
|
||||
+ const styleContext = this.get_style_context();
|
||||
+ styleContext.add_class('frame');
|
||||
+ styleContext.add_class('rich-list');
|
||||
+
|
||||
+ this.set_header_func(this._updateHeader.bind(this));
|
||||
+ this.connect('row-activated',
|
||||
+ (box, row) => row.activate());
|
||||
+ }
|
||||
+
|
||||
+ _updateHeader(row, before) {
|
||||
+ if (!before || row.get_header())
|
||||
+ return;
|
||||
+ row.set_header(new Gtk.Separator());
|
||||
+ }
|
||||
+});
|
||||
+
|
||||
+
|
||||
+var ActionRow = GObject.registerClass({
|
||||
+ Properties: {
|
||||
+ 'activatable-widget': GObject.ParamSpec.object(
|
||||
+ 'activatable-widget', 'activatable-widget', 'activatable-widget',
|
||||
+ GObject.ParamFlags.READWRITE,
|
||||
+ Gtk.Widget),
|
||||
+ 'title': GObject.ParamSpec.string(
|
||||
+ 'title', 'title', 'title',
|
||||
+ GObject.ParamFlags.READWRITE,
|
||||
+ null),
|
||||
+ },
|
||||
+}, class ActionRow extends Gtk.ListBoxRow {
|
||||
+ _init(params) {
|
||||
+ super._init(params);
|
||||
+
|
||||
+ const box = new Gtk.Box({
|
||||
+ valign: Gtk.Align.CENTER,
|
||||
+ spacing: 12,
|
||||
+ margin_top: 8,
|
||||
+ margin_bottom: 8,
|
||||
+ margin_start: 12,
|
||||
+ margin_end: 12,
|
||||
+ });
|
||||
+ this.add(box);
|
||||
+
|
||||
+ const provider = new Gtk.CssProvider();
|
||||
+ provider.load_from_data('* { min-height: 32px; }');
|
||||
+ box.get_style_context().add_provider(provider,
|
||||
+ Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
+
|
||||
+ this._prefixes = new Gtk.Box({
|
||||
+ spacing: 12,
|
||||
+ no_show_all: true,
|
||||
+ visible: false,
|
||||
+ });
|
||||
+ box.add(this._prefixes);
|
||||
+
|
||||
+ this._title = new Gtk.Label({
|
||||
+ hexpand: true,
|
||||
+ xalign: 0,
|
||||
+ });
|
||||
+ this._title.get_style_context().add_class('title');
|
||||
+ box.add(this._title);
|
||||
+
|
||||
+ this._suffixes = new Gtk.Box({
|
||||
+ spacing: 12,
|
||||
+ no_show_all: true,
|
||||
+ visible: false,
|
||||
+ });
|
||||
+ box.add(this._suffixes);
|
||||
+
|
||||
+ this.bind_property('title',
|
||||
+ this._title, 'label',
|
||||
+ GObject.BindingFlags.SYNC_CREATE);
|
||||
+ }
|
||||
+
|
||||
+ activate() {
|
||||
+ if (this.activatable_widget)
|
||||
+ this.activatable_widget.mnemonic_activate(false);
|
||||
+ }
|
||||
+
|
||||
+ add_prefix(child) {
|
||||
+ child.show();
|
||||
+ this._prefixes.add(child);
|
||||
+ this._prefixes.show();
|
||||
+ }
|
||||
+
|
||||
+ add_suffix(child) {
|
||||
+ child.show();
|
||||
+ this._suffixes.add(child);
|
||||
+ this._suffixes.show();
|
||||
+ }
|
||||
+});
|
||||
+
|
||||
+var ComboRow = GObject.registerClass({
|
||||
+ Properties: {
|
||||
+ 'selected-item': GObject.ParamSpec.object(
|
||||
+ 'selected-item', 'selected-item', 'selected-item',
|
||||
+ GObject.ParamFlags.READABLE,
|
||||
+ GObject.Object),
|
||||
+ },
|
||||
+}, class ComboRow extends ActionRow {
|
||||
+ _init(params) {
|
||||
+ super._init({
|
||||
+ ...params,
|
||||
+ activatable: true,
|
||||
+ });
|
||||
+
|
||||
+ const box = new Gtk.Box({
|
||||
+ valign: Gtk.Align.CENTER,
|
||||
+ });
|
||||
+ box.add(new Gtk.Image({
|
||||
+ icon_name: 'pan-down-symbolic',
|
||||
+ visible: true,
|
||||
+ }));
|
||||
+ this.add_suffix(box);
|
||||
+
|
||||
+ this._popover = new Gtk.Popover({
|
||||
+ relative_to: box,
|
||||
+ });
|
||||
+
|
||||
+ this._listBox = new Gtk.ListBox({
|
||||
+ activate_on_single_click: true,
|
||||
+ selection_mode: Gtk.SelectionMode.SINGLE,
|
||||
+ visible: true,
|
||||
+ });
|
||||
+ this._popover.add(this._listBox);
|
||||
+
|
||||
+ this._listBox.connect('row-activated', (view, row) => {
|
||||
+ this._selectedItem = row;
|
||||
+ this.notify('selected-item');
|
||||
+ this._popover.popdown();
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ get selected_item() {
|
||||
+ return this._selectedItem;
|
||||
+ }
|
||||
+
|
||||
+ add_row(row) {
|
||||
+ row.show();
|
||||
+ this._listBox.add(row);
|
||||
+ }
|
||||
+
|
||||
+ activate() {
|
||||
+ this._popover.popup();
|
||||
+ }
|
||||
+});
|
||||
+
|
||||
+const GenericPrefs = GObject.registerClass(
|
||||
+class GenericPrefs extends PreferencesGroup {
|
||||
+ _init() {
|
||||
+ super._init();
|
||||
+
|
||||
+ this._actionGroup = new Gio.SimpleActionGroup();
|
||||
+ this.insert_action_group('options', this._actionGroup);
|
||||
+
|
||||
+ this._actionGroup.add_action(settings.create_action('top-banner'));
|
||||
+ this._actionGroup.add_action(settings.create_action('bottom-banner'));
|
||||
+ this._actionGroup.add_action(settings.create_action('system-info'));
|
||||
+
|
||||
+ this.add(this._createSettingsRow('Top banner', 'top-banner'));
|
||||
+ this.add(this._createSettingsRow('Bottom banner', 'bottom-banner'));
|
||||
+ this.add(this._createSettingsRow('System info', 'system-info'));
|
||||
+ }
|
||||
+
|
||||
+ _createSettingsRow(title, key) {
|
||||
+ const activatableWidget = new Gtk.Switch({
|
||||
+ valign: Gtk.Align.CENTER,
|
||||
+ action_name: `options.${key}`,
|
||||
+ });
|
||||
+ const row = new ActionRow({
|
||||
+ activatableWidget,
|
||||
+ title,
|
||||
+ });
|
||||
+ row.add_prefix(activatableWidget);
|
||||
+
|
||||
+ return row;
|
||||
+ }
|
||||
+});
|
||||
+
|
||||
+const BannerPreset = GObject.registerClass({
|
||||
+ Properties: {
|
||||
+ 'message': GObject.ParamSpec.string(
|
||||
+ 'message', 'message', 'message',
|
||||
+ GObject.ParamFlags.READWRITE,
|
||||
+ null),
|
||||
+ 'color': GObject.ParamSpec.string(
|
||||
+ 'color', 'color', 'color',
|
||||
+ GObject.ParamFlags.READWRITE,
|
||||
+ null),
|
||||
+ 'background-color': GObject.ParamSpec.string(
|
||||
+ 'background-color', 'background-color', 'background-color',
|
||||
+ GObject.ParamFlags.READWRITE,
|
||||
+ null),
|
||||
+ },
|
||||
+}, class BannerPreset extends Gtk.ListBoxRow {
|
||||
+ _init(params) {
|
||||
+ super._init(params);
|
||||
+
|
||||
+ const label = new Gtk.Label({
|
||||
+ label: this.message,
|
||||
+ visible: true,
|
||||
+ });
|
||||
+ this.add(label);
|
||||
+
|
||||
+ const provider = new Gtk.CssProvider();
|
||||
+ provider.load_from_data(`* {
|
||||
+ border-radius: 99px;
|
||||
+ padding: 6px;
|
||||
+ color: ${this.color};
|
||||
+ background-color: ${this.background_color};
|
||||
+ }`);
|
||||
+ label.get_style_context().add_provider(provider,
|
||||
+ Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
+ }
|
||||
+});
|
||||
+
|
||||
+const AppearancePrefs = GObject.registerClass(
|
||||
+class AppearancePrefs extends PreferencesGroup {
|
||||
+ _init() {
|
||||
+ super._init();
|
||||
+
|
||||
+ let row, activatableWidget;
|
||||
+ row = new ComboRow({
|
||||
+ title: _('Presets'),
|
||||
+ });
|
||||
+ row.add_row(new BannerPreset({
|
||||
+ message: 'UNCLASSIFIED',
|
||||
+ color: '#fff',
|
||||
+ background_color: 'rgba(0, 122, 51, 0.75)',
|
||||
+ }));
|
||||
+ row.add_row(new BannerPreset({
|
||||
+ message: 'CONFIDENTIAL',
|
||||
+ color: '#fff',
|
||||
+ background_color: 'rgba(0, 51, 160, 0.75)',
|
||||
+ }));
|
||||
+ row.add_row(new BannerPreset({
|
||||
+ message: 'SECRET',
|
||||
+ color: '#fff',
|
||||
+ background_color: 'rgba(200, 16, 46, 0.75)',
|
||||
+ }));
|
||||
+ row.add_row(new BannerPreset({
|
||||
+ message: 'TOP SECRET',
|
||||
+ color: '#fff',
|
||||
+ background_color: 'rgba(255, 103, 31, 0.75)',
|
||||
+ }));
|
||||
+ row.add_row(new BannerPreset({
|
||||
+ message: 'TOP SECRET//SCI',
|
||||
+ color: '#000',
|
||||
+ background_color: 'rgba(247, 234, 72, 0.75)',
|
||||
+ }));
|
||||
+
|
||||
+ row.connect('notify::selected-item', comboRow => {
|
||||
+ const { message, color, background_color: backgroundColor } =
|
||||
+ comboRow.selected_item;
|
||||
+ settings.set_string('message', message);
|
||||
+ settings.set_string('color', color);
|
||||
+ settings.set_string('background-color', backgroundColor);
|
||||
+ });
|
||||
+ this.add(row);
|
||||
+
|
||||
+ activatableWidget = new Gtk.Entry({
|
||||
+ valign: Gtk.Align.CENTER,
|
||||
+ });
|
||||
+ settings.bind('message',
|
||||
+ activatableWidget, 'text',
|
||||
+ Gio.SettingsBindFlags.DEFAULT);
|
||||
+ row = new ActionRow({ title: _('Message'), activatableWidget });
|
||||
+ row.add_suffix(activatableWidget);
|
||||
+ this.add(row);
|
||||
+
|
||||
+ activatableWidget = this._createColorButton('background-color', {
|
||||
+ use_alpha: true,
|
||||
+ });
|
||||
+ row = new ActionRow({ title: _('Background color'), activatableWidget });
|
||||
+ row.add_suffix(activatableWidget);
|
||||
+ this.add(row);
|
||||
+
|
||||
+ activatableWidget = this._createColorButton('color');
|
||||
+ row = new ActionRow({ title: _('Text color'), activatableWidget });
|
||||
+ row.add_suffix(activatableWidget);
|
||||
+ this.add(row);
|
||||
+ }
|
||||
+
|
||||
+ _createColorButton(key, params = {}) {
|
||||
+ const rgba = new Gdk.RGBA();
|
||||
+ rgba.parse(settings.get_string(key));
|
||||
+
|
||||
+ const button = new Gtk.ColorButton({
|
||||
+ ...params,
|
||||
+ rgba,
|
||||
+ valign: Gtk.Align.CENTER,
|
||||
+ });
|
||||
+ settings.connect(`changed::${key}`, () => {
|
||||
+ const newRgba = new Gdk.RGBA();
|
||||
+ newRgba.parse(settings.get_string(key));
|
||||
+ if (!newRgba.equal(button.rgba))
|
||||
+ button.set({ rgba: newRgba });
|
||||
+ });
|
||||
+ button.connect('notify::rgba',
|
||||
+ () => settings.set_string(key, button.rgba.to_string()));
|
||||
+ return button;
|
||||
+ }
|
||||
+});
|
||||
+
|
||||
+const ClassificationPrefs = GObject.registerClass(
|
||||
+class ClassificationPrefs extends Gtk.ScrolledWindow {
|
||||
+ _init() {
|
||||
+ super._init({
|
||||
+ hscrollbar_policy: Gtk.PolicyType.NEVER,
|
||||
+ });
|
||||
+
|
||||
+ const box = new Gtk.Box({
|
||||
+ orientation: Gtk.Orientation.VERTICAL,
|
||||
+ halign: Gtk.Align.CENTER,
|
||||
+ visible: true,
|
||||
+ spacing: 24,
|
||||
+ margin_top: 24,
|
||||
+ margin_bottom: 24,
|
||||
+ margin_start: 12,
|
||||
+ margin_end: 12,
|
||||
+ });
|
||||
+ this.add(box);
|
||||
+
|
||||
+ const provider = new Gtk.CssProvider();
|
||||
+ provider.load_from_data('* { min-width: 500px; }');
|
||||
+ box.get_style_context().add_provider(provider,
|
||||
+ Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
+
|
||||
+ box.add(new AppearancePrefs());
|
||||
+ box.add(new GenericPrefs());
|
||||
+
|
||||
+ this.show_all();
|
||||
+ }
|
||||
+});
|
||||
+
|
||||
+/** */
|
||||
+function init() {
|
||||
+ ExtensionUtils.initTranslations();
|
||||
+ settings = ExtensionUtils.getSettings();
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * @returns {Gtk.Widget} - the prefs widget
|
||||
+ */
|
||||
+function buildPrefsWidget() {
|
||||
+ return new ClassificationPrefs();
|
||||
+}
|
||||
diff --git a/extensions/classification-banner/stylesheet.css b/extensions/classification-banner/stylesheet.css
|
||||
new file mode 100644
|
||||
index 00000000..fb6a697e
|
||||
--- /dev/null
|
||||
+++ b/extensions/classification-banner/stylesheet.css
|
||||
@@ -0,0 +1,3 @@
|
||||
+.classification-system-info { padding: 0 24px; }
|
||||
+.classification-message { font-weight: bold; }
|
||||
+.classification-banner { font-size: 0.9em; }
|
||||
diff --git a/meson.build b/meson.build
|
||||
index d4791263..75a2beaa 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -50,6 +50,7 @@ default_extensions += [
|
||||
all_extensions = default_extensions
|
||||
all_extensions += [
|
||||
'auto-move-windows',
|
||||
+ 'classification-banner',
|
||||
'dash-to-dock',
|
||||
'dash-to-panel',
|
||||
'disable-screenshield',
|
||||
--
|
||||
2.33.1
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
Name: gnome-shell-extensions
|
||||
Version: 3.32.1
|
||||
Release: 25%{?dist}
|
||||
Release: 27%{?dist}
|
||||
Summary: Modify and extend GNOME Shell functionality and behavior
|
||||
|
||||
Group: User Interface/Desktops
|
||||
@ -57,6 +57,7 @@ optional functionality to GNOME Shell.
|
||||
Enabled extensions:
|
||||
* apps-menu
|
||||
* auto-move-windows
|
||||
* classification-banner
|
||||
* dash-to-dock
|
||||
* dash-to-panel
|
||||
* disable-screenshield
|
||||
@ -152,6 +153,16 @@ workspace can be assigned to each application as soon as it creates a window, in
|
||||
a manner configurable with a GSettings key.
|
||||
|
||||
|
||||
%package -n %{pkg_prefix}-classification-banner
|
||||
Summary: Display classification level banner in GNOME Shell
|
||||
Group: User Interface/Desktops
|
||||
License: GPLv2+
|
||||
Requires: %{pkg_prefix}-common = %{version}-%{release}
|
||||
|
||||
%description -n %{pkg_prefix}-classification-banner
|
||||
This GNOME Shell extension adds a banner that displays the classification level.
|
||||
|
||||
|
||||
%package -n %{pkg_prefix}-dash-to-dock
|
||||
Summary: Show the dash outside the activities overview
|
||||
Group: User Interface/Desktops
|
||||
@ -431,6 +442,11 @@ cp $RPM_SOURCE_DIR/gnome-classic.desktop $RPM_BUILD_ROOT%{_datadir}/xsessions
|
||||
%{_datadir}/gnome-shell/extensions/auto-move-windows*/
|
||||
|
||||
|
||||
%files -n %{pkg_prefix}-classification-banner
|
||||
%{_datadir}/glib-2.0/schemas/org.gnome.shell.extensions.classification-banner.gschema.xml
|
||||
%{_datadir}/gnome-shell/extensions/classification-banner*/
|
||||
|
||||
|
||||
%files -n %{pkg_prefix}-dash-to-dock
|
||||
%{_datadir}/glib-2.0/schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml
|
||||
%{_datadir}/gnome-shell/extensions/dash-to-dock*/
|
||||
@ -531,6 +547,14 @@ cp $RPM_SOURCE_DIR/gnome-classic.desktop $RPM_BUILD_ROOT%{_datadir}/xsessions
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Dec 14 2021 Florian Müllner <fmuellner@redhat.com> - 3.32.1-27
|
||||
- Keep classification banners on login/lock screen
|
||||
Resolves: #1751336
|
||||
|
||||
* Fri Dec 10 2021 Florian Müllner <fmuellner@redhat.com> - 3.32.1-26
|
||||
- Add classification-banner
|
||||
Resolves: #1751336
|
||||
|
||||
* Mon Nov 29 2021 Florian Müllner <fmuellner@redhat.com> - 3.32.1-25
|
||||
- Fix desktop-icons warning
|
||||
Resolves: #2026622
|
||||
|
Loading…
Reference in New Issue
Block a user