diff --git a/.gitignore b/.gitignore index 2d2b47d..2fd83a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea -node_modules \ No newline at end of file +node_modules +dist diff --git a/Makefile b/Makefile index 3258c2e..1993441 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -NAME=my-extension -DOMAIN=example.com +NAME=prettyborders +DOMAIN=lucaso.io .PHONY: all pack install clean diff --git a/extension.js b/extension.ts similarity index 100% rename from extension.js rename to extension.ts diff --git a/prefs.ts b/prefs.ts new file mode 100644 index 0000000..1a3989c --- /dev/null +++ b/prefs.ts @@ -0,0 +1,51 @@ +import Gtk from 'gi://Gtk'; +import Adw from 'gi://Adw'; +import Gio from 'gi://Gio'; +import { ExtensionPreferences, gettext as _ } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'; + +export default class GnomeRectanglePreferences extends ExtensionPreferences { + _settings?: Gio.Settings + + fillPreferencesWindow(window: Adw.PreferencesWindow) { + this._settings = this.getSettings(); + + const page = new Adw.PreferencesPage({ + title: _('General'), + iconName: 'dialog-information-symbolic', + }); + + const animationGroup = new Adw.PreferencesGroup({ + title: _('Animation'), + description: _('Configure move/resize animation'), + }); + page.add(animationGroup); + + const animationEnabled = new Adw.SwitchRow({ + title: _('Enabled'), + subtitle: _('Wether to animate windows'), + }); + animationGroup.add(animationEnabled); + + const paddingGroup = new Adw.PreferencesGroup({ + title: _('Paddings'), + description: _('Configure the padding between windows'), + }); + page.add(paddingGroup); + + const paddingInner = new Adw.SpinRow({ + title: _('Inner'), + subtitle: _('Padding between windows'), + adjustment: new Gtk.Adjustment({ + lower: 0, + upper: 1000, + stepIncrement: 1 + }) + }); + paddingGroup.add(paddingInner); + + window.add(page) + + this._settings!.bind('animate', animationEnabled, 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings!.bind('padding-inner', paddingInner, 'value', Gio.SettingsBindFlags.DEFAULT); + } +} \ No newline at end of file