gnome 45, version 10

This commit is contained in:
JerryXiao 2023-09-20 10:37:03 +08:00
parent 62f9ad1cd3
commit 7f394453c8
Signed by: Jerry
GPG key ID: 22618F758B5BE2E5
3 changed files with 171 additions and 176 deletions

View file

@ -14,16 +14,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
* /
/* exported init */
const St = imports.gi.St
const Main = imports.ui.main
const Mainloop = imports.mainloop
const ExtensionUtils = imports.misc.extensionUtils
const Me = ExtensionUtils.getCurrentExtension()
*/
class Extension {
constructor() {
import St from 'gi://St'
import * as Main from 'resource:///org/gnome/shell/ui/main.js'
import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js'
export default class ActivateGnomeExtension extends Extension {
constructor(metadata) {
super(metadata)
this.labels = []
this.settings = null
this.handlers = []
@ -65,7 +64,7 @@ class Extension {
}
enable() {
this.settings = ExtensionUtils.getSettings(Me.metadata['settings-schema'])
this.settings = this.getSettings()
this.handlers.push({
owner: this.settings,
id: this.settings.connect('changed', () => this.update())
@ -90,8 +89,3 @@ class Extension {
this.settings = null
}
}
function init() {
log(`initializing ${Me.metadata.name}`)
return new Extension()
}

View file

@ -4,12 +4,8 @@
"uuid": "activate_gnome@isjerryxiao",
"settings-schema": "org.gnome.shell.extensions.activate_gnome",
"shell-version": [
"40",
"41",
"42",
"43",
"44"
"45"
],
"version": 9,
"version": 10,
"url": "https://github.com/isjerryxiao/gnome-shell-extension-activate-gnome"
}

View file

@ -1,14 +1,18 @@
const Gio = imports.gi.Gio
const Gtk = imports.gi.Gtk
import Gio from 'gi://Gio'
import Gtk from 'gi://Gtk'
import Adw from 'gi://Adw'
const ExtensionUtils = imports.misc.extensionUtils
const Me = ExtensionUtils.getCurrentExtension()
import { ExtensionPreferences } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'
function init() {
}
export default class ActivateGnomeExtensionPreferences extends ExtensionPreferences {
fillPreferencesWindow(window) {
const page = new Adw.PreferencesPage()
window.add(page)
function buildPrefsWidget() {
this.settings = ExtensionUtils.getSettings(Me.metadata['settings-schema'])
const group = new Adw.PreferencesGroup()
page.add(group)
this.settings = this.getSettings()
let prefsWidget = new Gtk.Box({
orientation: Gtk.Orientation.VERTICAL,
@ -154,5 +158,6 @@ function buildPrefsWidget() {
this.settings.bind('size-l2', spinbutton_line_2_text_size.adjustment, 'value', Gio.SettingsBindFlags.DEFAULT)
this.settings.bind('opacity', scale_opacity.adjustment, 'value', Gio.SettingsBindFlags.DEFAULT)
return prefsWidget
group.add(prefsWidget);
}
}