gnome 45, version 10
This commit is contained in:
parent
62f9ad1cd3
commit
7f394453c8
3 changed files with 171 additions and 176 deletions
|
@ -14,16 +14,15 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* 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 {
|
import St from 'gi://St'
|
||||||
constructor() {
|
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.labels = []
|
||||||
this.settings = null
|
this.settings = null
|
||||||
this.handlers = []
|
this.handlers = []
|
||||||
|
@ -65,7 +64,7 @@ class Extension {
|
||||||
}
|
}
|
||||||
|
|
||||||
enable() {
|
enable() {
|
||||||
this.settings = ExtensionUtils.getSettings(Me.metadata['settings-schema'])
|
this.settings = this.getSettings()
|
||||||
this.handlers.push({
|
this.handlers.push({
|
||||||
owner: this.settings,
|
owner: this.settings,
|
||||||
id: this.settings.connect('changed', () => this.update())
|
id: this.settings.connect('changed', () => this.update())
|
||||||
|
@ -90,8 +89,3 @@ class Extension {
|
||||||
this.settings = null
|
this.settings = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
|
||||||
log(`initializing ${Me.metadata.name}`)
|
|
||||||
return new Extension()
|
|
||||||
}
|
|
||||||
|
|
|
@ -4,12 +4,8 @@
|
||||||
"uuid": "activate_gnome@isjerryxiao",
|
"uuid": "activate_gnome@isjerryxiao",
|
||||||
"settings-schema": "org.gnome.shell.extensions.activate_gnome",
|
"settings-schema": "org.gnome.shell.extensions.activate_gnome",
|
||||||
"shell-version": [
|
"shell-version": [
|
||||||
"40",
|
"45"
|
||||||
"41",
|
|
||||||
"42",
|
|
||||||
"43",
|
|
||||||
"44"
|
|
||||||
],
|
],
|
||||||
"version": 9,
|
"version": 10,
|
||||||
"url": "https://github.com/isjerryxiao/gnome-shell-extension-activate-gnome"
|
"url": "https://github.com/isjerryxiao/gnome-shell-extension-activate-gnome"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
const Gio = imports.gi.Gio
|
import Gio from 'gi://Gio'
|
||||||
const Gtk = imports.gi.Gtk
|
import Gtk from 'gi://Gtk'
|
||||||
|
import Adw from 'gi://Adw'
|
||||||
|
|
||||||
const ExtensionUtils = imports.misc.extensionUtils
|
import { ExtensionPreferences } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'
|
||||||
const Me = ExtensionUtils.getCurrentExtension()
|
|
||||||
|
|
||||||
function init() {
|
export default class ActivateGnomeExtensionPreferences extends ExtensionPreferences {
|
||||||
}
|
fillPreferencesWindow(window) {
|
||||||
|
const page = new Adw.PreferencesPage()
|
||||||
|
window.add(page)
|
||||||
|
|
||||||
function buildPrefsWidget() {
|
const group = new Adw.PreferencesGroup()
|
||||||
this.settings = ExtensionUtils.getSettings(Me.metadata['settings-schema'])
|
page.add(group)
|
||||||
|
|
||||||
|
this.settings = this.getSettings()
|
||||||
|
|
||||||
let prefsWidget = new Gtk.Box({
|
let prefsWidget = new Gtk.Box({
|
||||||
orientation: Gtk.Orientation.VERTICAL,
|
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('size-l2', spinbutton_line_2_text_size.adjustment, 'value', Gio.SettingsBindFlags.DEFAULT)
|
||||||
this.settings.bind('opacity', scale_opacity.adjustment, 'value', Gio.SettingsBindFlags.DEFAULT)
|
this.settings.bind('opacity', scale_opacity.adjustment, 'value', Gio.SettingsBindFlags.DEFAULT)
|
||||||
|
|
||||||
return prefsWidget
|
group.add(prefsWidget);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue