import Adw from 'gi://Adw'; import Gtk from 'gi://Gtk'; import {ExtensionPreferences} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'; export default class OrgAgendaIndicatorPreferences extends ExtensionPreferences { fillPreferencesWindow(window) { const settings = this.getSettings('org.gnome.shell.extensions.org-agenda-indicator'); const page = new Adw.PreferencesPage(); const group = new Adw.PreferencesGroup({ title: 'Display', description: 'Configure what the indicator shows.', }); const row = new Adw.ActionRow({ title: 'Show clocked-in task', subtitle: 'Display the active Org clock in the panel and menu when one is running.', }); const toggle = new Gtk.Switch({ active: settings.get_boolean('show-clocked-in-task'), valign: Gtk.Align.CENTER, }); toggle.connect('notify::active', widget => { settings.set_boolean('show-clocked-in-task', widget.get_active()); }); row.add_suffix(toggle); row.activatable_widget = toggle; group.add(row); page.add(group); window.add(page); } }