updated to latest version, gnome 46 support
This commit is contained in:
+12
-13
@@ -17,12 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import Clutter from 'gi://Clutter';
|
import Clutter from 'gi://Clutter';
|
||||||
import Gio from 'gi://Gio';
|
|
||||||
import GLib from 'gi://GLib';
|
|
||||||
import GObject from 'gi://GObject';
|
|
||||||
import Meta from 'gi://Meta';
|
|
||||||
import Shell from 'gi://Shell';
|
|
||||||
import St from 'gi://St';
|
|
||||||
|
|
||||||
import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';
|
import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||||
@@ -30,7 +25,17 @@ import { MessageTray } from 'resource:///org/gnome/shell/ui/messageTray.js';
|
|||||||
import * as Utils from './utils.js';
|
import * as Utils from './utils.js';
|
||||||
|
|
||||||
const BannerBin = Main.messageTray._bannerBin;
|
const BannerBin = Main.messageTray._bannerBin;
|
||||||
|
|
||||||
|
/* Imports necessary by the code pulled in from messageTray.js */
|
||||||
import { State, Urgency } from 'resource:///org/gnome/shell/ui/messageTray.js';
|
import { State, Urgency } from 'resource:///org/gnome/shell/ui/messageTray.js';
|
||||||
|
import Gio from 'gi://Gio';
|
||||||
|
import GLib from 'gi://GLib';
|
||||||
|
import GObject from 'gi://GObject';
|
||||||
|
import Meta from 'gi://Meta';
|
||||||
|
import Shell from 'gi://Shell';
|
||||||
|
import St from 'gi://St';
|
||||||
|
import * as Calendar from 'resource:///org/gnome/shell/ui/calendar.js'
|
||||||
|
|
||||||
|
|
||||||
const NOTIFICATION_TIMEOUT = 4000;
|
const NOTIFICATION_TIMEOUT = 4000;
|
||||||
const HIDE_TIMEOUT = 200;
|
const HIDE_TIMEOUT = 200;
|
||||||
@@ -53,8 +58,7 @@ function patcher(obj, live, method, original, patch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getMessageTraySize = () => {
|
const getMessageTraySize = () => {
|
||||||
var width, height;
|
const { width, height } = Main.layoutManager.getWorkAreaForMonitor(global.display.get_primary_monitor());
|
||||||
var { width, height } = Main.layoutManager.getWorkAreaForMonitor(global.display.get_primary_monitor());
|
|
||||||
return {width, height};
|
return {width, height};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,8 +242,3 @@ export default class NotificationExtension extends Extension {
|
|||||||
MessageTray.prototype._updateShowingNotification = originalUpdateShowing;
|
MessageTray.prototype._updateShowingNotification = originalUpdateShowing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
|
||||||
return new Extension();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -1,11 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "Notification Banner Reloaded",
|
"name": "Notification Banner Reloaded",
|
||||||
"version": 9,
|
|
||||||
"_generated": "Generated by SweetTooth, do not edit",
|
"_generated": "Generated by SweetTooth, do not edit",
|
||||||
"description": "Configure notification banner position and animation to your liking.\nVersion 9: Gnome 45 changes by mannjani@github",
|
"description": "Configure notification banner position and animation to your liking.\nVersion 9: Gnome 45 changes by mannjani@github\nVersion 10: mannjani@github added a test button inside prefs",
|
||||||
"uuid": "notification-banner-reloaded@marcinjakubowski.github.com",
|
"uuid": "notification-banner-reloaded@marcinjakubowski.github.com",
|
||||||
"shell-version": [
|
"shell-version": [
|
||||||
"45"
|
"45", "46"
|
||||||
],
|
],
|
||||||
"url": "https://github.com/marcinjakubowski/notification-position-reloaded",
|
"url": "https://github.com/marcinjakubowski/notification-position-reloaded",
|
||||||
"settings-schema": "org.gnome.shell.extensions.notification-banner-reloaded"
|
"settings-schema": "org.gnome.shell.extensions.notification-banner-reloaded"
|
||||||
|
|||||||
@@ -29,23 +29,6 @@ import * as Utils from './utils.js';
|
|||||||
|
|
||||||
import {ExtensionPreferences, gettext as _} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
|
import {ExtensionPreferences, gettext as _} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
|
||||||
|
|
||||||
|
|
||||||
// API change 3 -> 4
|
|
||||||
function addBox(box, child) {
|
|
||||||
if (imports.gi.versions.Gtk.startsWith("3")) {
|
|
||||||
box.add(child);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
box.append(child);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
let localeDir = './locale';
|
|
||||||
if (localeDir.query_exists(null))
|
|
||||||
Gettext.bindtextdomain('notification-banner-reloaded', localeDir.get_path());
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class NotificationExtensionPreferences extends ExtensionPreferences {
|
export default class NotificationExtensionPreferences extends ExtensionPreferences {
|
||||||
constructor(metadata) {
|
constructor(metadata) {
|
||||||
super(metadata);
|
super(metadata);
|
||||||
@@ -54,7 +37,7 @@ export default class NotificationExtensionPreferences extends ExtensionPreferenc
|
|||||||
getPreferencesWidget() {
|
getPreferencesWidget() {
|
||||||
let frame = new Gtk.Box();
|
let frame = new Gtk.Box();
|
||||||
let widget = new Preferences(this.getSettings());
|
let widget = new Preferences(this.getSettings());
|
||||||
addBox(frame, widget.main);
|
frame.append(widget.main);
|
||||||
if (frame.show_all)
|
if (frame.show_all)
|
||||||
frame.show_all();
|
frame.show_all();
|
||||||
return frame;
|
return frame;
|
||||||
|
|||||||
Reference in New Issue
Block a user