mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 16:24:03 +09:00
Add dedicated switch for g-s app switcher isolation
gh-2378
This commit is contained in:
@@ -35,7 +35,6 @@ import * as Utils from './utils.js'
|
|||||||
import * as DesktopIconsIntegration from './desktopIconsIntegration.js'
|
import * as DesktopIconsIntegration from './desktopIconsIntegration.js'
|
||||||
import { DTP_EXTENSION, SETTINGS, tracker } from './extension.js'
|
import { DTP_EXTENSION, SETTINGS, tracker } from './extension.js'
|
||||||
|
|
||||||
import Gio from 'gi://Gio'
|
|
||||||
import GLib from 'gi://GLib'
|
import GLib from 'gi://GLib'
|
||||||
import GObject from 'gi://GObject'
|
import GObject from 'gi://GObject'
|
||||||
import Clutter from 'gi://Clutter'
|
import Clutter from 'gi://Clutter'
|
||||||
@@ -107,8 +106,6 @@ export const PanelManager = class {
|
|||||||
|
|
||||||
if (reset) return
|
if (reset) return
|
||||||
|
|
||||||
this._syncAppSwitcherWorkspaceIsolation()
|
|
||||||
|
|
||||||
this.notificationsMonitor = new NotificationsMonitor()
|
this.notificationsMonitor = new NotificationsMonitor()
|
||||||
|
|
||||||
this._desktopIconsUsableArea =
|
this._desktopIconsUsableArea =
|
||||||
@@ -274,11 +271,6 @@ export const PanelManager = class {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
|
||||||
SETTINGS,
|
|
||||||
'changed::isolate-workspaces',
|
|
||||||
this._syncAppSwitcherWorkspaceIsolation,
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
Utils.DisplayWrapper.getMonitorManager(),
|
Utils.DisplayWrapper.getMonitorManager(),
|
||||||
'monitors-changed',
|
'monitors-changed',
|
||||||
@@ -426,18 +418,6 @@ export const PanelManager = class {
|
|||||||
this._desktopIconsUsableArea = null
|
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() {}
|
_emptyFunc() {}
|
||||||
|
|
||||||
_setDesktopIconsMargins() {
|
_setDesktopIconsMargins() {
|
||||||
|
|||||||
36
src/prefs.js
36
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/BoxSecondaryMenuOptions.ui')
|
||||||
this._builder.add_from_file(this._path + '/ui/BoxScrollPanelOptions.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/BoxScrollIconOptions.ui')
|
||||||
|
this._builder.add_from_file(
|
||||||
|
this._path + '/ui/BoxIsolateWorkspacesOptions.ui',
|
||||||
|
)
|
||||||
|
|
||||||
// pages
|
// pages
|
||||||
this._builder.add_from_file(this._path + '/ui/SettingsPosition.ui')
|
this._builder.add_from_file(this._path + '/ui/SettingsPosition.ui')
|
||||||
@@ -2565,6 +2568,39 @@ const Preferences = class {
|
|||||||
Gio.SettingsBindFlags.DEFAULT,
|
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(
|
this._settings.bind(
|
||||||
'isolate-monitors',
|
'isolate-monitors',
|
||||||
this._builder.get_object('multimon_multi_isolate_monitor_switch'),
|
this._builder.get_object('multimon_multi_isolate_monitor_switch'),
|
||||||
|
|||||||
35
ui/BoxIsolateWorkspacesOptions.ui
Normal file
35
ui/BoxIsolateWorkspacesOptions.ui
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk" version="4.0"/>
|
||||||
|
<requires lib="libadwaita" version="1.2"/>
|
||||||
|
<object class="GtkScrolledWindow" id="box_isolate_workspaces_options">
|
||||||
|
<property name="height-request">300</property>
|
||||||
|
<property name="vexpand">True</property>
|
||||||
|
<property name="width-request">600</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="margin-bottom">32</property>
|
||||||
|
<property name="margin-end">32</property>
|
||||||
|
<property name="margin-start">32</property>
|
||||||
|
<property name="margin-top">32</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">24</property>
|
||||||
|
<child>
|
||||||
|
<object class="AdwPreferencesGroup">
|
||||||
|
<child>
|
||||||
|
<object class="AdwActionRow">
|
||||||
|
<property name="subtitle">Alt-Tab menu</property>
|
||||||
|
<property name="title" translatable="yes">Isolate workspaces in gnome-shell Application Switcher</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSwitch" id="isolate_workspaces_app_switcher_switch">
|
||||||
|
<property name="valign">center</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
@@ -1,15 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk" version="4.0"/>
|
<requires lib="gtk" version="4.0"/>
|
||||||
|
<requires lib="libadwaita" version="1.7"/>
|
||||||
<object class="AdwPreferencesPage" id="behavior">
|
<object class="AdwPreferencesPage" id="behavior">
|
||||||
|
<property name="icon-name">preferences-system-symbolic</property>
|
||||||
<property name="title" translatable="yes">Behavior</property>
|
<property name="title" translatable="yes">Behavior</property>
|
||||||
<property name="icon_name">preferences-system-symbolic</property>
|
|
||||||
|
|
||||||
<!-- group applications -->
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwPreferencesGroup" id="behavior_group_applications">
|
<object class="AdwPreferencesGroup" id="behavior_group_applications">
|
||||||
<property name="title" translatable="yes">Applications</property>
|
<property name="title" translatable="yes">Applications</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="title" translatable="yes">Show favorite applications</property>
|
<property name="title" translatable="yes">Show favorite applications</property>
|
||||||
@@ -20,7 +18,6 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="title" translatable="yes">Show favorite applications on secondary panels</property>
|
<property name="title" translatable="yes">Show favorite applications on secondary panels</property>
|
||||||
@@ -31,7 +28,6 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="title" translatable="yes">Show running applications</property>
|
<property name="title" translatable="yes">Show running applications</property>
|
||||||
@@ -42,17 +38,16 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="title" translatable="yes">Ungroup applications</property>
|
<property name="title" translatable="yes">Ungroup applications</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="show_group_apps_options_button">
|
<object class="GtkButton" id="show_group_apps_options_button">
|
||||||
<property name="receives_default">True</property>
|
<property name="receives-default">True</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage" id="image_show_group_apps_options">
|
<object class="GtkImage" id="image_show_group_apps_options">
|
||||||
<property name="icon_name">emblem-system-symbolic</property>
|
<property name="icon-name">emblem-system-symbolic</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<style>
|
<style>
|
||||||
@@ -67,38 +62,33 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="title" translatable="yes">Show notification counter badge</property>
|
<property name="title" translatable="yes">Show notification counter badge</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSwitch" id="show_notification_badge_switch">
|
<object class="GtkSwitch" id="show_notification_badge_switch">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="halign">end</property>
|
<property name="halign">end</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<!-- group hover -->
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwPreferencesGroup" id="behavior_group_hover">
|
<object class="AdwPreferencesGroup" id="behavior_group_hover">
|
||||||
<property name="title" translatable="yes">Hover</property>
|
<property name="title" translatable="yes">Hover</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="title" translatable="yes">Show window previews on hover</property>
|
<property name="title" translatable="yes">Show window previews on hover</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="show_window_previews_button">
|
<object class="GtkButton" id="show_window_previews_button">
|
||||||
<property name="receives_default">True</property>
|
<property name="receives-default">True</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage" id="image_window_previews_options">
|
<object class="GtkImage" id="image_window_previews_options">
|
||||||
<property name="icon_name">emblem-system-symbolic</property>
|
<property name="icon-name">emblem-system-symbolic</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<style>
|
<style>
|
||||||
@@ -113,7 +103,6 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="title" translatable="yes">Show tooltip on hover</property>
|
<property name="title" translatable="yes">Show tooltip on hover</property>
|
||||||
@@ -124,18 +113,28 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<!-- group isolate -->
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwPreferencesGroup" id="behavior_group_isolate">
|
<object class="AdwPreferencesGroup" id="behavior_group_isolate">
|
||||||
<property name="title" translatable="yes">Isolate</property>
|
<property name="title" translatable="yes">Isolate</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="title" translatable="yes">Isolate Workspaces</property>
|
<property name="title" translatable="yes">Isolate Workspaces</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="isolate_workspaces_button">
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage" id="image_isolate_workspaces_options">
|
||||||
|
<property name="icon-name">emblem-system-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<style>
|
||||||
|
<class name="circular"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSwitch" id="isolate_workspaces_switch">
|
<object class="GtkSwitch" id="isolate_workspaces_switch">
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
@@ -143,7 +142,6 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="title" translatable="yes">Isolate monitors</property>
|
<property name="title" translatable="yes">Isolate monitors</property>
|
||||||
@@ -154,15 +152,11 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<!-- group overview -->
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwPreferencesGroup" id="behavior_group_overview">
|
<object class="AdwPreferencesGroup" id="behavior_group_overview">
|
||||||
<property name="title" translatable="yes">Overview</property>
|
<property name="title" translatable="yes">Overview</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="title" translatable="yes">Click empty space to close overview</property>
|
<property name="title" translatable="yes">Click empty space to close overview</property>
|
||||||
@@ -173,7 +167,6 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="title" translatable="yes">Disable show overview on startup</property>
|
<property name="title" translatable="yes">Disable show overview on startup</property>
|
||||||
@@ -184,9 +177,7 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
</object>
|
</object>
|
||||||
</interface>
|
</interface>
|
||||||
|
|||||||
Reference in New Issue
Block a user