diff --git a/src/panelManager.js b/src/panelManager.js index ace6588..dcf0bce 100755 --- a/src/panelManager.js +++ b/src/panelManager.js @@ -35,7 +35,6 @@ import * as Utils from './utils.js' import * as DesktopIconsIntegration from './desktopIconsIntegration.js' import { DTP_EXTENSION, SETTINGS, tracker } from './extension.js' -import Gio from 'gi://Gio' import GLib from 'gi://GLib' import GObject from 'gi://GObject' import Clutter from 'gi://Clutter' @@ -107,8 +106,6 @@ export const PanelManager = class { if (reset) return - this._syncAppSwitcherWorkspaceIsolation() - this.notificationsMonitor = new NotificationsMonitor() this._desktopIconsUsableArea = @@ -274,11 +271,6 @@ export const PanelManager = class { }) }, ], - [ - SETTINGS, - 'changed::isolate-workspaces', - this._syncAppSwitcherWorkspaceIsolation, - ], [ Utils.DisplayWrapper.getMonitorManager(), 'monitors-changed', @@ -426,18 +418,6 @@ export const PanelManager = class { this._desktopIconsUsableArea = null } - _syncAppSwitcherWorkspaceIsolation() { - // alt-tab menu - let appSwitcherSettings = new Gio.Settings({ - schema_id: 'org.gnome.shell.app-switcher', - }) - - appSwitcherSettings.set_boolean( - 'current-workspace-only', - SETTINGS.get_boolean('isolate-workspaces'), - ) - } - _emptyFunc() {} _setDesktopIconsMargins() { diff --git a/src/prefs.js b/src/prefs.js index e2c8b1f..27c86a1 100644 --- a/src/prefs.js +++ b/src/prefs.js @@ -181,6 +181,9 @@ const Preferences = class { this._builder.add_from_file(this._path + '/ui/BoxSecondaryMenuOptions.ui') this._builder.add_from_file(this._path + '/ui/BoxScrollPanelOptions.ui') this._builder.add_from_file(this._path + '/ui/BoxScrollIconOptions.ui') + this._builder.add_from_file( + this._path + '/ui/BoxIsolateWorkspacesOptions.ui', + ) // pages this._builder.add_from_file(this._path + '/ui/SettingsPosition.ui') @@ -2565,6 +2568,39 @@ const Preferences = class { Gio.SettingsBindFlags.DEFAULT, ) + let appSwitcherSettings = new Gio.Settings({ + schema_id: 'org.gnome.shell.app-switcher', + }) + + appSwitcherSettings.bind( + 'current-workspace-only', + this._builder.get_object('isolate_workspaces_app_switcher_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT, + ) + + this._builder + .get_object('isolate_workspaces_button') + .connect('clicked', () => { + let scrolledWindow = this._builder.get_object( + 'box_isolate_workspaces_options', + ) + + let dialog = this._createPreferencesDialog( + _('Isolate Workspaces options'), + scrolledWindow, + () => { + // restore default settings + appSwitcherSettings.set_value( + 'current-workspace-only', + appSwitcherSettings.get_default_value('current-workspace-only'), + ) + }, + ) + + dialog.show() + }) + this._settings.bind( 'isolate-monitors', this._builder.get_object('multimon_multi_isolate_monitor_switch'), diff --git a/ui/BoxIsolateWorkspacesOptions.ui b/ui/BoxIsolateWorkspacesOptions.ui new file mode 100644 index 0000000..4c353f5 --- /dev/null +++ b/ui/BoxIsolateWorkspacesOptions.ui @@ -0,0 +1,35 @@ + + + + + + 300 + True + 600 + + + 32 + 32 + 32 + 32 + vertical + 24 + + + + + Alt-Tab menu + Isolate workspaces in gnome-shell Application Switcher + + + center + + + + + + + + + + diff --git a/ui/SettingsBehavior.ui b/ui/SettingsBehavior.ui index c56b7c7..bba198e 100644 --- a/ui/SettingsBehavior.ui +++ b/ui/SettingsBehavior.ui @@ -1,15 +1,13 @@ - + + + preferences-system-symbolic Behavior - preferences-system-symbolic - - Applications - Show favorite applications @@ -20,7 +18,6 @@ - Show favorite applications on secondary panels @@ -31,7 +28,6 @@ - Show running applications @@ -42,17 +38,16 @@ - Ungroup applications - True + True center - emblem-system-symbolic + emblem-system-symbolic + + center @@ -143,7 +142,6 @@ - Isolate monitors @@ -154,15 +152,11 @@ - - - Overview - Click empty space to close overview @@ -173,7 +167,6 @@ - Disable show overview on startup @@ -184,9 +177,7 @@ - - - \ No newline at end of file +