mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Merge pull request #1958 from andyholmes/andyholmes/gnome-45-review
GNOME 45 Review
This commit is contained in:
56
appIcons.js
56
appIcons.js
@@ -23,27 +23,23 @@
|
||||
|
||||
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://GLib';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import Gtk from 'gi://Gtk';
|
||||
import GObject from 'gi://GObject';
|
||||
import Mtk from 'gi://Mtk';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
import * as Config from 'resource:///org/gnome/shell/misc/config.js';
|
||||
import * as AppDisplay from 'resource:///org/gnome/shell/ui/appDisplay.js';
|
||||
import * as AppMenu from 'resource:///org/gnome/shell/ui/appMenu.js';
|
||||
import * as AppFavorites from 'resource:///org/gnome/shell/ui/appFavorites.js';
|
||||
import * as Dash from 'resource:///org/gnome/shell/ui/dash.js';
|
||||
import * as DND from 'resource:///org/gnome/shell/ui/dnd.js';
|
||||
import * as IconGrid from 'resource:///org/gnome/shell/ui/iconGrid.js';
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
|
||||
import * as Util from 'resource:///org/gnome/shell/misc/util.js';
|
||||
import * as Workspace from 'resource:///org/gnome/shell/ui/workspace.js';
|
||||
import * as BoxPointer from 'resource:///org/gnome/shell/ui/boxpointer.js';
|
||||
import {EventEmitter} from 'resource:///org/gnome/shell/misc/signals.js';
|
||||
|
||||
import * as Utils from './utils.js';
|
||||
import * as PanelSettings from './panelSettings.js';
|
||||
@@ -52,9 +48,6 @@ import * as Progress from './progress.js';
|
||||
import {DTP_EXTENSION, SETTINGS, DESKTOPSETTINGS, EXTENSION_PATH} from './extension.js';
|
||||
import {gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
|
||||
const Mainloop = imports.mainloop;
|
||||
const {signals: Signals} = imports;
|
||||
|
||||
//timeout names
|
||||
const T2 = 'mouseScrollTimeout';
|
||||
const T3 = 'showDotsTimeout';
|
||||
@@ -68,7 +61,7 @@ const DOUBLE_CLICK_DELAY_MS = 450;
|
||||
|
||||
let LABEL_GAP = 5;
|
||||
let MAX_INDICATORS = 4;
|
||||
export var DEFAULT_PADDING_SIZE = 4;
|
||||
export const DEFAULT_PADDING_SIZE = 4;
|
||||
|
||||
let DOT_STYLE = {
|
||||
DOTS: "DOTS",
|
||||
@@ -108,7 +101,7 @@ let tracker = Shell.WindowTracker.get_default();
|
||||
*
|
||||
*/
|
||||
|
||||
export var TaskbarAppIcon = GObject.registerClass({
|
||||
export const TaskbarAppIcon = GObject.registerClass({
|
||||
}, class TaskbarAppIcon extends AppDisplay.AppIcon {
|
||||
|
||||
_init(appInfo, panel, iconParams, previewMenu, iconAnimator) {
|
||||
@@ -585,7 +578,7 @@ export var TaskbarAppIcon = GObject.registerClass({
|
||||
let highlightMargin = this._focusedIsWide ? SETTINGS.get_int('dot-size') : 0;
|
||||
|
||||
if(!this.window) {
|
||||
let containerWidth = this._dtpIconContainer.get_width() / Utils.getScaleFactor();;
|
||||
let containerWidth = this._dtpIconContainer.get_width() / Utils.getScaleFactor();
|
||||
let backgroundSize = containerWidth + "px " +
|
||||
(containerWidth - (pos == DOT_POSITION.BOTTOM ? highlightMargin : 0)) + "px;";
|
||||
|
||||
@@ -1342,9 +1335,10 @@ export function cycleThroughWindows(app, reversed, shouldMinimize, monitor) {
|
||||
app_windows.push("MINIMIZE");
|
||||
|
||||
if (recentlyClickedAppLoopId > 0)
|
||||
Mainloop.source_remove(recentlyClickedAppLoopId);
|
||||
GLib.Source.remove(recentlyClickedAppLoopId);
|
||||
|
||||
recentlyClickedAppLoopId = Mainloop.timeout_add(MEMORY_TIME, resetRecentlyClickedApp);
|
||||
recentlyClickedAppLoopId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
|
||||
MEMORY_TIME, resetRecentlyClickedApp);
|
||||
|
||||
// If there isn't already a list of windows for the current app,
|
||||
// or the stored list is outdated, use the current windows list.
|
||||
@@ -1374,7 +1368,7 @@ export function cycleThroughWindows(app, reversed, shouldMinimize, monitor) {
|
||||
|
||||
export function resetRecentlyClickedApp() {
|
||||
if (recentlyClickedAppLoopId > 0)
|
||||
Mainloop.source_remove(recentlyClickedAppLoopId);
|
||||
GLib.Source.remove(recentlyClickedAppLoopId);
|
||||
|
||||
recentlyClickedAppLoopId=0;
|
||||
recentlyClickedApp =null;
|
||||
@@ -1418,10 +1412,10 @@ export function getInterestingWindows(app, monitor, isolateMonitors) {
|
||||
}
|
||||
|
||||
export function cssHexTocssRgba(cssHex, opacity) {
|
||||
var bigint = parseInt(cssHex.slice(1), 16);
|
||||
var r = (bigint >> 16) & 255;
|
||||
var g = (bigint >> 8) & 255;
|
||||
var b = bigint & 255;
|
||||
let bigint = parseInt(cssHex.slice(1), 16);
|
||||
let r = (bigint >> 16) & 255;
|
||||
let g = (bigint >> 8) & 255;
|
||||
let b = bigint & 255;
|
||||
|
||||
return 'rgba(' + [r, g, b].join(',') + ',' + opacity + ')';
|
||||
}
|
||||
@@ -1497,11 +1491,14 @@ export class TaskbarSecondaryMenu extends AppMenu.AppMenu {
|
||||
|
||||
if (windows.length == this._app.get_windows().length)
|
||||
this._app.request_quit()
|
||||
|
||||
GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
|
||||
windows.forEach((w) => !!w.get_compositor_private() && w.delete(time++));
|
||||
|
||||
Mainloop.idle_add(() =>
|
||||
windows.forEach((w) => !!w.get_compositor_private() && w.delete(time++)))
|
||||
return GLib.SOURCE_REMOVE;
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used for extendDashItemContainer
|
||||
@@ -1573,7 +1570,7 @@ export function ItemShowLabel() {
|
||||
time: duration,
|
||||
transition: 'easeOutQuad',
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* A wrapper class around the ShowAppsIcon class.
|
||||
@@ -1587,9 +1584,11 @@ export function ItemShowLabel() {
|
||||
* use of this class in place of the original showAppsButton.
|
||||
*
|
||||
*/
|
||||
export var ShowAppsIconWrapper = class {
|
||||
export const ShowAppsIconWrapper = class extends EventEmitter {
|
||||
|
||||
constructor(dtpPanel) {
|
||||
super();
|
||||
|
||||
this.realShowAppsIcon = new Dash.ShowAppsIcon();
|
||||
|
||||
/* the variable equivalent to toggleButton has a different name in the appIcon class
|
||||
@@ -1731,12 +1730,11 @@ export var ShowAppsIconWrapper = class {
|
||||
this.realShowAppsIcon.destroy();
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(ShowAppsIconWrapper.prototype);
|
||||
|
||||
/**
|
||||
* A menu for the showAppsIcon
|
||||
*/
|
||||
export var MyShowAppsIconMenu = class extends PopupMenu.PopupMenu {
|
||||
export const MyShowAppsIconMenu = class extends PopupMenu.PopupMenu {
|
||||
|
||||
constructor(actor, dtpPanel) {
|
||||
super(actor, 0, dtpPanel.getPosition());
|
||||
@@ -1835,7 +1833,7 @@ export var MyShowAppsIconMenu = class extends PopupMenu.PopupMenu {
|
||||
|
||||
// Only add menu entries for commands that exist in path
|
||||
_appendItem(info) {
|
||||
if (Utils.checkIfCommandExists(info.cmd[0])) {
|
||||
if (GLib.find_program_in_path(info.cmd[0])) {
|
||||
let item = this._appendMenuItem(_(info.title));
|
||||
|
||||
item.connect('activate', function() {
|
||||
@@ -1853,7 +1851,7 @@ export var MyShowAppsIconMenu = class extends PopupMenu.PopupMenu {
|
||||
return;
|
||||
}
|
||||
|
||||
for (var entry = 0; entry < commandList.length; entry++) {
|
||||
for (let entry = 0; entry < commandList.length; entry++) {
|
||||
_appendItem({
|
||||
title: titleList[entry],
|
||||
cmd: commandList[entry].split(' ')
|
||||
@@ -1875,7 +1873,7 @@ export var MyShowAppsIconMenu = class extends PopupMenu.PopupMenu {
|
||||
};
|
||||
|
||||
|
||||
export var getIconContainerStyle = function(isVertical) {
|
||||
export const getIconContainerStyle = function(isVertical) {
|
||||
let style = 'padding: ';
|
||||
|
||||
if (SETTINGS.get_boolean('group-apps')) {
|
||||
|
||||
@@ -64,7 +64,7 @@ import * as ExtensionUtils from 'resource:///org/gnome/shell/misc/extensionUtils
|
||||
|
||||
const IDENTIFIER_UUID = "130cbc66-235c-4bd6-8571-98d2d8bba5e2";
|
||||
|
||||
export var DesktopIconsUsableAreaClass = class {
|
||||
export const DesktopIconsUsableAreaClass = class {
|
||||
constructor() {
|
||||
this._extensionManager = Main.extensionManager;
|
||||
this._timedMarginsID = 0;
|
||||
|
||||
49
extension.js
49
extension.js
@@ -18,37 +18,31 @@
|
||||
*/
|
||||
|
||||
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import Meta from 'gi://Meta';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as WindowManager from 'resource:///org/gnome/shell/ui/windowManager.js';
|
||||
import * as ExtensionUtils from 'resource:///org/gnome/shell/misc/extensionUtils.js';;
|
||||
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import {EventEmitter} from 'resource:///org/gnome/shell/misc/signals.js';
|
||||
import {Extension, gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
|
||||
import * as PanelManager from './panelManager.js';
|
||||
import * as Utils from './utils.js';
|
||||
import * as AppIcons from './appIcons.js';
|
||||
|
||||
import {Extension, gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
|
||||
const Mainloop = imports.mainloop;
|
||||
const {signals: Signals} = imports;
|
||||
|
||||
const UBUNTU_DOCK_UUID = 'ubuntu-dock@ubuntu.com';
|
||||
|
||||
let panelManager;
|
||||
let extensionChangedHandler;
|
||||
let startupCompleteHandler;
|
||||
let disabledUbuntuDock;
|
||||
let extensionSystem = Main.extensionManager;
|
||||
|
||||
export var DTP_EXTENSION = null;
|
||||
export var SETTINGS = null;
|
||||
export var DESKTOPSETTINGS = null;
|
||||
export var PERSISTENTSTORAGE = null;
|
||||
export var EXTENSION_UUID = null;
|
||||
export var EXTENSION_PATH = null;
|
||||
export let DTP_EXTENSION = null;
|
||||
export let SETTINGS = null;
|
||||
export let DESKTOPSETTINGS = null;
|
||||
export let PERSISTENTSTORAGE = null;
|
||||
export let EXTENSION_UUID = null;
|
||||
export let EXTENSION_PATH = null;
|
||||
|
||||
export default class DashToPanelExtension extends Extension {
|
||||
constructor(metadata) {
|
||||
@@ -56,8 +50,6 @@ export default class DashToPanelExtension extends Extension {
|
||||
console.log(`Initiating ${this.uuid}`);
|
||||
|
||||
this._realHasOverview = Main.sessionMode.hasOverview;
|
||||
|
||||
this.initTranslations();
|
||||
|
||||
//create an object that persists until gnome-shell is restarted, even if the extension is disabled
|
||||
PERSISTENTSTORAGE = {};
|
||||
@@ -76,8 +68,7 @@ export default class DashToPanelExtension extends Extension {
|
||||
});
|
||||
|
||||
//create a global object that can emit signals and conveniently expose functionalities to other extensions
|
||||
global.dashToPanel = {};
|
||||
Signals.addSignalMethods(global.dashToPanel);
|
||||
global.dashToPanel = new EventEmitter();
|
||||
|
||||
_enable(this);
|
||||
}
|
||||
@@ -87,6 +78,7 @@ export default class DashToPanelExtension extends Extension {
|
||||
|
||||
DTP_EXTENSION = null;
|
||||
SETTINGS = null;
|
||||
DESKTOPSETTINGS = null;
|
||||
panelManager = null;
|
||||
|
||||
if (!reset) {
|
||||
@@ -101,14 +93,17 @@ export default class DashToPanelExtension extends Extension {
|
||||
AppIcons.resetRecentlyClickedApp();
|
||||
}
|
||||
|
||||
if (startupCompleteHandler) {
|
||||
Main.layoutManager.disconnect(startupCompleteHandler);
|
||||
startupCompleteHandler = null;
|
||||
}
|
||||
|
||||
Main.sessionMode.hasOverview = this._realHasOverview;
|
||||
}
|
||||
}
|
||||
|
||||
function _enable(extension) {
|
||||
let ubuntuDock = Main.extensionManager ?
|
||||
Main.extensionManager.lookup(UBUNTU_DOCK_UUID) : //gnome-shell >= 3.33.4
|
||||
ExtensionUtils.extensions[UBUNTU_DOCK_UUID];
|
||||
let ubuntuDock = Main.extensionManager.lookup(UBUNTU_DOCK_UUID);
|
||||
|
||||
if (ubuntuDock && ubuntuDock.stateObj && ubuntuDock.stateObj.dockManager) {
|
||||
// Disable Ubuntu Dock
|
||||
@@ -122,14 +117,14 @@ function _enable(extension) {
|
||||
|
||||
//reset to prevent conflicts with the ubuntu-dock
|
||||
if (panelManager) {
|
||||
disable(true);
|
||||
extension.disable(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (panelManager) return; //already initialized
|
||||
|
||||
SETTINGS = extension.getSettings('org.gnome.shell.extensions.dash-to-panel');
|
||||
DESKTOPSETTINGS = extension.getSettings('org.gnome.desktop.interface');
|
||||
DESKTOPSETTINGS = new Gio.Settings({schema_id: 'org.gnome.desktop.interface'});
|
||||
EXTENSION_UUID = extension.uuid
|
||||
EXTENSION_PATH = extension.path
|
||||
|
||||
@@ -137,7 +132,7 @@ function _enable(extension) {
|
||||
|
||||
if (SETTINGS.get_boolean('hide-overview-on-startup') && Main.layoutManager._startingUp) {
|
||||
Main.sessionMode.hasOverview = false;
|
||||
Main.layoutManager.connect('startup-complete', () => {
|
||||
startupCompleteHandler = Main.layoutManager.connect('startup-complete', () => {
|
||||
Main.sessionMode.hasOverview = extension._realHasOverview
|
||||
});
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import * as OverviewControls from 'resource:///org/gnome/shell/ui/overviewControls.js';
|
||||
import * as PointerWatcher from 'resource:///org/gnome/shell/ui/pointerWatcher.js';
|
||||
|
||||
import * as Panel from './panel.js';
|
||||
import * as Proximity from './proximity.js';
|
||||
import * as Utils from './utils.js';
|
||||
import {SETTINGS} from './extension.js';
|
||||
@@ -43,15 +42,15 @@ const T2 = 'limitUpdateTimeout';
|
||||
const T3 = 'postAnimateTimeout';
|
||||
const T4 = 'panelBoxClipTimeout';
|
||||
|
||||
var SIDE_CONTROLS_ANIMATION_TIME = OverviewControls.SIDE_CONTROLS_ANIMATION_TIME / (OverviewControls.SIDE_CONTROLS_ANIMATION_TIME > 1 ? 1000 : 1);
|
||||
const SIDE_CONTROLS_ANIMATION_TIME = OverviewControls.SIDE_CONTROLS_ANIMATION_TIME / (OverviewControls.SIDE_CONTROLS_ANIMATION_TIME > 1 ? 1000 : 1);
|
||||
|
||||
export var Hold = {
|
||||
export const Hold = {
|
||||
NONE: 0,
|
||||
TEMPORARY: 1,
|
||||
PERMANENT: 2
|
||||
};
|
||||
|
||||
export var Intellihide = class {
|
||||
export const Intellihide = class {
|
||||
|
||||
constructor(dtpPanel) {
|
||||
this._dtpPanel = dtpPanel;
|
||||
@@ -424,4 +423,4 @@ export var Intellihide = class {
|
||||
|
||||
this._hoveredOut = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,13 +28,10 @@ import Gio from 'gi://Gio';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import * as Workspace from 'resource:///org/gnome/shell/ui/workspace.js';
|
||||
import * as WindowManager from 'resource:///org/gnome/shell/ui/windowManager.js';
|
||||
import {WindowPreview} from 'resource:///org/gnome/shell/ui/windowPreview.js';
|
||||
import {SETTINGS} from './extension.js';
|
||||
|
||||
import Meta from 'gi://Meta';
|
||||
|
||||
const GS_HOTKEYS_KEY = 'switch-to-application-';
|
||||
|
||||
// When the dash is shown, workspace window preview bottom labels go over it (default
|
||||
@@ -46,7 +43,7 @@ const LABEL_MARGIN = 60;
|
||||
const T1 = 'swipeEndTimeout';
|
||||
const T2 = 'numberOverlayTimeout';
|
||||
|
||||
export var Overview = class {
|
||||
export const Overview = class {
|
||||
|
||||
constructor() {
|
||||
this._numHotkeys = 10;
|
||||
@@ -518,4 +515,4 @@ export var Overview = class {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
17
panel.js
17
panel.js
@@ -28,8 +28,6 @@
|
||||
*/
|
||||
|
||||
import Clutter from 'gi://Clutter';
|
||||
import * as Config from 'resource:///org/gnome/shell/misc/config.js';
|
||||
import Gtk from 'gi://Gtk';
|
||||
import GObject from 'gi://GObject';
|
||||
import * as AppIcons from './appIcons.js';
|
||||
import * as Utils from './utils.js';
|
||||
@@ -43,13 +41,11 @@ import * as Dash from 'resource:///org/gnome/shell/ui/dash.js';
|
||||
import * as CtrlAltTab from 'resource:///org/gnome/shell/ui/ctrlAltTab.js';
|
||||
import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js';
|
||||
import St from 'gi://St';
|
||||
import GLib from 'gi://GLib';
|
||||
import Meta from 'gi://Meta';
|
||||
import Pango from 'gi://Pango';
|
||||
import * as DND from 'resource:///org/gnome/shell/ui/dnd.js';
|
||||
import Shell from 'gi://Shell';
|
||||
import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
|
||||
import * as IconGrid from 'resource:///org/gnome/shell/ui/iconGrid.js';
|
||||
import * as DateMenu from 'resource:///org/gnome/shell/ui/dateMenu.js';
|
||||
import * as Volume from 'resource:///org/gnome/shell/ui/status/volume.js';
|
||||
import * as Progress from './progress.js';
|
||||
@@ -59,11 +55,8 @@ import * as Transparency from './transparency.js';
|
||||
import {SETTINGS, DESKTOPSETTINGS, PERSISTENTSTORAGE} from './extension.js';
|
||||
import {gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
|
||||
const Mainloop = imports.mainloop;
|
||||
const Gi = imports._gi;
|
||||
|
||||
let tracker = Shell.WindowTracker.get_default();
|
||||
export var panelBoxes = ['_leftBox', '_centerBox', '_rightBox'];
|
||||
export const panelBoxes = ['_leftBox', '_centerBox', '_rightBox'];
|
||||
|
||||
//timeout names
|
||||
const T2 = 'startIntellihideTimeout';
|
||||
@@ -72,7 +65,7 @@ const T5 = 'trackerFocusAppTimeout';
|
||||
const T6 = 'scrollPanelDelayTimeout';
|
||||
const T7 = 'waitPanelBoxAllocation';
|
||||
|
||||
export var Panel = GObject.registerClass({
|
||||
export const Panel = GObject.registerClass({
|
||||
}, class Panel extends St.Widget {
|
||||
|
||||
_init(panelManager, monitor, panelBox, isStandalone) {
|
||||
@@ -1230,7 +1223,7 @@ export var Panel = GObject.registerClass({
|
||||
return;
|
||||
}
|
||||
|
||||
var scrollDelay = SETTINGS.get_int('scroll-panel-delay');
|
||||
const scrollDelay = SETTINGS.get_int('scroll-panel-delay');
|
||||
|
||||
if (scrollDelay) {
|
||||
this._timeoutsHandler.add([T6, scrollDelay, () => {}]);
|
||||
@@ -1256,7 +1249,7 @@ export var Panel = GObject.registerClass({
|
||||
}
|
||||
});
|
||||
|
||||
export var SecondaryPanel = GObject.registerClass({
|
||||
export const SecondaryPanel = GObject.registerClass({
|
||||
}, class SecondaryPanel extends St.Widget {
|
||||
|
||||
_init(params) {
|
||||
@@ -1266,4 +1259,4 @@ export var SecondaryPanel = GObject.registerClass({
|
||||
vfunc_allocate(box) {
|
||||
this.set_allocation(box);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -31,7 +31,6 @@ import * as Overview from './overview.js';
|
||||
import * as Panel from './panel.js';
|
||||
import * as PanelSettings from './panelSettings.js';
|
||||
import * as Proximity from './proximity.js';
|
||||
import * as Taskbar from './taskbar.js';
|
||||
import * as Utils from './utils.js';
|
||||
import * as DesktopIconsIntegration from './desktopIconsIntegration.js';
|
||||
|
||||
@@ -42,21 +41,16 @@ import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
import * as AppDisplay from 'resource:///org/gnome/shell/ui/appDisplay.js';
|
||||
import * as BoxPointer from 'resource:///org/gnome/shell/ui/boxpointer.js';
|
||||
import * as Dash from 'resource:///org/gnome/shell/ui/dash.js';
|
||||
import * as IconGrid from 'resource:///org/gnome/shell/ui/iconGrid.js';
|
||||
import * as LookingGlass from 'resource:///org/gnome/shell/ui/lookingGlass.js';
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js';
|
||||
import * as Layout from 'resource:///org/gnome/shell/ui/layout.js';
|
||||
import * as WM from 'resource:///org/gnome/shell/ui/windowManager.js';
|
||||
import {SETTINGS} from './extension.js';
|
||||
import {SecondaryMonitorDisplay, WorkspacesView} from 'resource:///org/gnome/shell/ui/workspacesView.js';
|
||||
|
||||
const Gi = imports._gi;
|
||||
|
||||
export var PanelManager = class {
|
||||
export const PanelManager = class {
|
||||
|
||||
constructor() {
|
||||
this.overview = new Overview.Overview();
|
||||
@@ -529,7 +523,7 @@ export var PanelManager = class {
|
||||
|
||||
// This class drives long-running icon animations, to keep them running in sync
|
||||
// with each other.
|
||||
export var IconAnimator = class {
|
||||
export const IconAnimator = class {
|
||||
|
||||
constructor(actor) {
|
||||
this._count = 0;
|
||||
|
||||
@@ -15,31 +15,31 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export var SHOW_APPS_BTN = 'showAppsButton';
|
||||
export var ACTIVITIES_BTN = 'activitiesButton';
|
||||
export var TASKBAR = 'taskbar';
|
||||
export var DATE_MENU = 'dateMenu';
|
||||
export var SYSTEM_MENU = 'systemMenu';
|
||||
export var LEFT_BOX = 'leftBox';
|
||||
export var CENTER_BOX = 'centerBox';
|
||||
export var RIGHT_BOX = 'rightBox';
|
||||
export var DESKTOP_BTN = 'desktopButton';
|
||||
export const SHOW_APPS_BTN = 'showAppsButton';
|
||||
export const ACTIVITIES_BTN = 'activitiesButton';
|
||||
export const TASKBAR = 'taskbar';
|
||||
export const DATE_MENU = 'dateMenu';
|
||||
export const SYSTEM_MENU = 'systemMenu';
|
||||
export const LEFT_BOX = 'leftBox';
|
||||
export const CENTER_BOX = 'centerBox';
|
||||
export const RIGHT_BOX = 'rightBox';
|
||||
export const DESKTOP_BTN = 'desktopButton';
|
||||
|
||||
export var STACKED_TL = 'stackedTL';
|
||||
export var STACKED_BR = 'stackedBR';
|
||||
export var CENTERED = 'centered';
|
||||
export var CENTERED_MONITOR = 'centerMonitor';
|
||||
export const STACKED_TL = 'stackedTL';
|
||||
export const STACKED_BR = 'stackedBR';
|
||||
export const CENTERED = 'centered';
|
||||
export const CENTERED_MONITOR = 'centerMonitor';
|
||||
|
||||
export var TOP = 'TOP';
|
||||
export var BOTTOM = 'BOTTOM';
|
||||
export var LEFT = 'LEFT';
|
||||
export var RIGHT = 'RIGHT';
|
||||
export const TOP = 'TOP';
|
||||
export const BOTTOM = 'BOTTOM';
|
||||
export const LEFT = 'LEFT';
|
||||
export const RIGHT = 'RIGHT';
|
||||
|
||||
export var START = 'START';
|
||||
export var MIDDLE = 'MIDDLE';
|
||||
export var END = 'END';
|
||||
export const START = 'START';
|
||||
export const MIDDLE = 'MIDDLE';
|
||||
export const END = 'END';
|
||||
|
||||
export var defaults = [
|
||||
export const defaults = [
|
||||
{ element: SHOW_APPS_BTN, visible: true, position: STACKED_TL },
|
||||
{ element: ACTIVITIES_BTN, visible: false, position: STACKED_TL },
|
||||
{ element: LEFT_BOX, visible: true, position: STACKED_TL },
|
||||
@@ -51,11 +51,11 @@ export var defaults = [
|
||||
{ element: DESKTOP_BTN, visible: true, position: STACKED_BR },
|
||||
];
|
||||
|
||||
export var optionDialogFunctions = {};
|
||||
export const optionDialogFunctions = {};
|
||||
|
||||
optionDialogFunctions[SHOW_APPS_BTN] = '_showShowAppsButtonOptions';
|
||||
optionDialogFunctions[DESKTOP_BTN] = '_showDesktopButtonOptions';
|
||||
|
||||
export function checkIfCentered(position) {
|
||||
return position == CENTERED || position == CENTERED_MONITOR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,19 +21,11 @@
|
||||
* mathematical.coffee@gmail.com
|
||||
*/
|
||||
|
||||
import * as ExtensionUtils from 'resource:///org/gnome/shell/misc/extensionUtils.js';;
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import St from 'gi://St';
|
||||
import Shell from 'gi://Shell';
|
||||
|
||||
import * as Panel from './panel.js';
|
||||
import * as Taskbar from './taskbar.js';
|
||||
import * as Utils from './utils.js';
|
||||
import {SETTINGS} from './extension.js';
|
||||
|
||||
const Mainloop = imports.mainloop;
|
||||
|
||||
export var PanelStyle = class {
|
||||
export const PanelStyle = class {
|
||||
|
||||
enable(panel) {
|
||||
this.panel = panel;
|
||||
|
||||
46
prefs.js
46
prefs.js
@@ -25,7 +25,6 @@ import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Gtk from 'gi://Gtk';
|
||||
import Adw from 'gi://Adw';
|
||||
import Gdk from 'gi://Gdk';
|
||||
|
||||
import * as PanelSettings from './panelSettings.js';
|
||||
@@ -33,10 +32,6 @@ import * as Pos from './panelPositions.js';
|
||||
|
||||
import {ExtensionPreferences, gettext as _, ngettext} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
|
||||
|
||||
const Mainloop = imports.mainloop;
|
||||
|
||||
const N_ = function(e) { return e };
|
||||
|
||||
const SCALE_UPDATE_TIMEOUT = 500;
|
||||
const DEFAULT_PANEL_SIZES = [ 128, 96, 64, 48, 32, 24, 16 ];
|
||||
const DEFAULT_FONT_SIZES = [ 96, 64, 48, 32, 24, 16, 0 ];
|
||||
@@ -147,14 +142,14 @@ function checkHotkeyPrefix(settings) {
|
||||
}
|
||||
|
||||
function mergeObjects(main, bck) {
|
||||
for (var prop in bck) {
|
||||
for (const prop in bck) {
|
||||
if (!main.hasOwnProperty(prop) && bck.hasOwnProperty(prop)) {
|
||||
main[prop] = bck[prop];
|
||||
}
|
||||
}
|
||||
|
||||
return main;
|
||||
};
|
||||
}
|
||||
|
||||
const Preferences = class {
|
||||
|
||||
@@ -1938,7 +1933,7 @@ const Preferences = class {
|
||||
{objectName: 'panel_length_scale', valueName: '', range: LENGTH_MARKS }
|
||||
];
|
||||
|
||||
for(var idx in sizeScales) {
|
||||
for(const idx in sizeScales) {
|
||||
let size_scale = this._builder.get_object(sizeScales[idx].objectName);
|
||||
let range = sizeScales[idx].range;
|
||||
size_scale.set_range(range[range.length - 1], range[0]);
|
||||
@@ -2228,9 +2223,9 @@ const BuilderScope = GObject.registerClass({
|
||||
panel_size_scale_value_changed_cb(scale) {
|
||||
// Avoid settings the size continuously
|
||||
if (this._preferences._panel_size_timeout > 0)
|
||||
Mainloop.source_remove(this._preferences._panel_size_timeout);
|
||||
GLib.Source.remove(this._preferences._panel_size_timeout);
|
||||
|
||||
this._preferences._panel_size_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, (() => {
|
||||
this._preferences._panel_size_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => {
|
||||
const value = scale.get_value();
|
||||
const monitorSync = this._preferences._settings.get_boolean('panel-element-positions-monitors-sync');
|
||||
const monitorsToSetFor = monitorSync ? this._preferences.monitors : [this._preferences._currentMonitorIndex];
|
||||
@@ -2240,15 +2235,15 @@ const BuilderScope = GObject.registerClass({
|
||||
|
||||
this._preferences._panel_size_timeout = 0;
|
||||
return GLib.SOURCE_REMOVE;
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
tray_size_scale_value_changed_cb(scale) {
|
||||
// Avoid settings the size consinuosly
|
||||
if (this._preferences._tray_size_timeout > 0)
|
||||
Mainloop.source_remove(this._preferences._tray_size_timeout);
|
||||
GLib.Source.remove(this._preferences._tray_size_timeout);
|
||||
|
||||
this._preferences._tray_size_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => {
|
||||
this._preferences._tray_size_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => {)
|
||||
this._preferences._settings.set_int('tray-size', scale.get_value());
|
||||
this._preferences._tray_size_timeout = 0;
|
||||
return GLib.SOURCE_REMOVE;
|
||||
@@ -2258,9 +2253,9 @@ const BuilderScope = GObject.registerClass({
|
||||
leftbox_size_scale_value_changed_cb(scale) {
|
||||
// Avoid settings the size consinuosly
|
||||
if (this._preferences._leftbox_size_timeout > 0)
|
||||
Mainloop.source_remove(this._preferences._leftbox_size_timeout);
|
||||
GLib.Source.remove(this._preferences._leftbox_size_timeout);
|
||||
|
||||
this._preferences._leftbox_size_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => {
|
||||
this._preferences._leftbox_size_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => {
|
||||
this._preferences._settings.set_int('leftbox-size', scale.get_value());
|
||||
this._preferences._leftbox_size_timeout = 0;
|
||||
return GLib.SOURCE_REMOVE;
|
||||
@@ -2270,9 +2265,9 @@ const BuilderScope = GObject.registerClass({
|
||||
appicon_margin_scale_value_changed_cb(scale) {
|
||||
// Avoid settings the size consinuosly
|
||||
if (this._preferences._appicon_margin_timeout > 0)
|
||||
Mainloop.source_remove(this._preferences._appicon_margin_timeout);
|
||||
GLib.Source.remove(this._preferences._appicon_margin_timeout);
|
||||
|
||||
this._preferences._appicon_margin_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => {
|
||||
this._preferences._appicon_margin_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => {
|
||||
this._preferences._settings.set_int('appicon-margin', scale.get_value());
|
||||
this._preferences._appicon_margin_timeout = 0;
|
||||
return GLib.SOURCE_REMOVE;
|
||||
@@ -2282,9 +2277,9 @@ const BuilderScope = GObject.registerClass({
|
||||
appicon_padding_scale_value_changed_cb(scale) {
|
||||
// Avoid settings the size consinuosly
|
||||
if (this._preferences._appicon_padding_timeout > 0)
|
||||
Mainloop.source_remove(this._preferences._appicon_padding_timeout);
|
||||
GLib.Source.remove(this._preferences._appicon_padding_timeout);
|
||||
|
||||
this._preferences._appicon_padding_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => {
|
||||
this._preferences._appicon_padding_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => {
|
||||
this._preferences._settings.set_int('appicon-padding', scale.get_value());
|
||||
this._preferences._appicon_padding_timeout = 0;
|
||||
return GLib.SOURCE_REMOVE;
|
||||
@@ -2294,9 +2289,9 @@ const BuilderScope = GObject.registerClass({
|
||||
tray_padding_scale_value_changed_cb(scale) {
|
||||
// Avoid settings the size consinuosly
|
||||
if (this._preferences._tray_padding_timeout > 0)
|
||||
Mainloop.source_remove(this._preferences._tray_padding_timeout);
|
||||
GLib.Source.remove(this._preferences._tray_padding_timeout);
|
||||
|
||||
this._preferences._tray_padding_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => {
|
||||
this._preferences._tray_padding_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => {
|
||||
this._preferences._settings.set_int('tray-padding', scale.get_value());
|
||||
this._preferences._tray_padding_timeout = 0;
|
||||
return GLib.SOURCE_REMOVE;
|
||||
@@ -2306,9 +2301,9 @@ const BuilderScope = GObject.registerClass({
|
||||
statusicon_padding_scale_value_changed_cb(scale) {
|
||||
// Avoid settings the size consinuosly
|
||||
if (this._preferences._statusicon_padding_timeout > 0)
|
||||
Mainloop.source_remove(this._preferences._statusicon_padding_timeout);
|
||||
GLib.Source.remove(this._preferences._statusicon_padding_timeout);
|
||||
|
||||
this._preferences._statusicon_padding_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => {
|
||||
this._preferences._statusicon_padding_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => {
|
||||
this._preferences._settings.set_int('status-icon-padding', scale.get_value());
|
||||
this._preferences._statusicon_padding_timeout = 0;
|
||||
return GLib.SOURCE_REMOVE;
|
||||
@@ -2318,9 +2313,9 @@ const BuilderScope = GObject.registerClass({
|
||||
leftbox_padding_scale_value_changed_cb(scale) {
|
||||
// Avoid settings the size consinuosly
|
||||
if (this._preferences._leftbox_padding_timeout > 0)
|
||||
Mainloop.source_remove(this._preferences._leftbox_padding_timeout);
|
||||
GLib.Source.remove(this._preferences._leftbox_padding_timeout);
|
||||
|
||||
this._preferences._leftbox_padding_timeout = Mainloop.timeout_add(SCALE_UPDATE_TIMEOUT, () => {
|
||||
this._preferences._leftbox_padding_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => {
|
||||
this._preferences._settings.set_int('leftbox-padding', scale.get_value());
|
||||
this._preferences._leftbox_padding_timeout = 0;
|
||||
return GLib.SOURCE_REMOVE;
|
||||
@@ -2332,7 +2327,6 @@ const BuilderScope = GObject.registerClass({
|
||||
export default class DashToPanelPreferences extends ExtensionPreferences {
|
||||
fillPreferencesWindow(window) {
|
||||
window._settings = this.getSettings('org.gnome.shell.extensions.dash-to-panel');
|
||||
this.initTranslations();
|
||||
|
||||
// use default width or window
|
||||
window.set_default_size(0, 740);
|
||||
|
||||
18
progress.js
18
progress.js
@@ -19,6 +19,7 @@
|
||||
* This file is based on code from the Dash to Dock extension by micheleg
|
||||
*/
|
||||
|
||||
import Cairo from 'cairo';
|
||||
import Gio from 'gi://Gio';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Pango from 'gi://Pango';
|
||||
@@ -26,13 +27,14 @@ import St from 'gi://St';
|
||||
import * as Utils from './utils.js';
|
||||
import {SETTINGS} from './extension.js';
|
||||
|
||||
const Cairo = imports.cairo;
|
||||
const {signals: Signals} = imports;
|
||||
import {EventEmitter} from 'resource:///org/gnome/shell/misc/signals.js';
|
||||
|
||||
|
||||
export var ProgressManager = class {
|
||||
export const ProgressManager = class extends EventEmitter {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this._entriesByDBusName = {};
|
||||
|
||||
this._launcher_entry_dbus_signal_id =
|
||||
@@ -163,11 +165,12 @@ export var ProgressManager = class {
|
||||
}
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(ProgressManager.prototype);
|
||||
|
||||
export class AppProgress {
|
||||
export class AppProgress extends EventEmitter {
|
||||
|
||||
constructor(dbusName, appId, properties) {
|
||||
super();
|
||||
|
||||
this._dbusName = dbusName;
|
||||
this._appId = appId;
|
||||
this._count = 0;
|
||||
@@ -277,11 +280,10 @@ export class AppProgress {
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(AppProgress.prototype);
|
||||
}
|
||||
|
||||
|
||||
export var ProgressIndicator = class {
|
||||
export const ProgressIndicator = class {
|
||||
|
||||
constructor(source, progressManager) {
|
||||
this._source = source;
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import Meta from 'gi://Meta';
|
||||
import Mtk from 'gi://Mtk';
|
||||
|
||||
import * as Layout from 'resource:///org/gnome/shell/ui/layout.js';
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
|
||||
import * as Utils from './utils.js';
|
||||
@@ -29,7 +28,7 @@ const MIN_UPDATE_MS = 200;
|
||||
//timeout names
|
||||
const T1 = 'limitUpdateTimeout';
|
||||
|
||||
export var Mode = {
|
||||
export const Mode = {
|
||||
ALL_WINDOWS: 0,
|
||||
FOCUSED_WINDOWS: 1,
|
||||
MAXIMIZED_WINDOWS: 2
|
||||
@@ -66,7 +65,7 @@ export class ProximityWatch {
|
||||
}
|
||||
};
|
||||
|
||||
export var ProximityManager = class {
|
||||
export const ProximityManager = class {
|
||||
|
||||
constructor() {
|
||||
this._counter = 1;
|
||||
@@ -254,4 +253,4 @@ export var ProximityManager = class {
|
||||
metaWindow.get_monitor() == watch.monitorIndex ||
|
||||
windowRect.overlap(global.display.get_monitor_geometry(watch.monitorIndex)));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
50
taskbar.js
50
taskbar.js
@@ -27,21 +27,16 @@ import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import Gtk from 'gi://Gtk';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
import * as AppFavorites from 'resource:///org/gnome/shell/ui/appFavorites.js';
|
||||
import * as Dash from 'resource:///org/gnome/shell/ui/dash.js';
|
||||
import * as DND from 'resource:///org/gnome/shell/ui/dnd.js';
|
||||
import * as IconGrid from 'resource:///org/gnome/shell/ui/iconGrid.js';
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
|
||||
import * as Workspace from 'resource:///org/gnome/shell/ui/workspace.js';
|
||||
import {EventEmitter} from 'resource:///org/gnome/shell/misc/signals.js';
|
||||
|
||||
import * as AppIcons from './appIcons.js';
|
||||
import * as Panel from './panel.js';
|
||||
import * as PanelManager from './panelManager.js';
|
||||
import * as PanelSettings from './panelSettings.js';
|
||||
import * as Pos from './panelPositions.js';
|
||||
@@ -49,13 +44,11 @@ import * as Utils from './utils.js';
|
||||
import * as WindowPreview from './windowPreview.js';
|
||||
import {SETTINGS} from './extension.js';
|
||||
|
||||
const Mainloop = imports.mainloop;
|
||||
const {signals: Signals} = imports;
|
||||
const SearchController = Main.overview.searchController;
|
||||
|
||||
export var DASH_ANIMATION_TIME = Dash.DASH_ANIMATION_TIME / (Dash.DASH_ANIMATION_TIME > 1 ? 1000 : 1);
|
||||
var DASH_ITEM_HOVER_TIMEOUT = Dash.DASH_ITEM_HOVER_TIMEOUT;
|
||||
export var MIN_ICON_SIZE = 4;
|
||||
export const DASH_ANIMATION_TIME = Dash.DASH_ANIMATION_TIME / (Dash.DASH_ANIMATION_TIME > 1 ? 1000 : 1);
|
||||
const DASH_ITEM_HOVER_TIMEOUT = Dash.DASH_ITEM_HOVER_TIMEOUT;
|
||||
export const MIN_ICON_SIZE = 4;
|
||||
|
||||
const T1 = 'ensureAppIconVisibilityTimeout'
|
||||
const T2 = 'showLabelTimeout'
|
||||
@@ -73,7 +66,7 @@ const T3 = 'resetHoverTimeout'
|
||||
|
||||
export function extendDashItemContainer(dashItemContainer) {
|
||||
dashItemContainer.showLabel = AppIcons.ItemShowLabel;
|
||||
};
|
||||
}
|
||||
|
||||
const iconAnimationSettings = {
|
||||
_getDictValue(key) {
|
||||
@@ -119,7 +112,7 @@ const iconAnimationSettings = {
|
||||
* - modified chldBox calculations for when 'show-apps-at-top' option is checked
|
||||
* - handle horizontal dash
|
||||
*/
|
||||
export var TaskbarActor = GObject.registerClass({
|
||||
export const TaskbarActor = GObject.registerClass({
|
||||
}, class TaskbarActor extends St.Widget {
|
||||
_init(delegate) {
|
||||
this._delegate = delegate;
|
||||
@@ -200,9 +193,11 @@ export var TaskbarActor = GObject.registerClass({
|
||||
* - Sync minimization application target position.
|
||||
*/
|
||||
|
||||
export var Taskbar = class {
|
||||
export const Taskbar = class extends EventEmitter {
|
||||
|
||||
constructor(panel) {
|
||||
super();
|
||||
|
||||
this.dtpPanel = panel;
|
||||
|
||||
// start at smallest size due to running indicator drawing area expanding but not shrinking
|
||||
@@ -225,8 +220,8 @@ export var Taskbar = class {
|
||||
|
||||
this._container = new TaskbarActor(this);
|
||||
this._scrollView = new St.ScrollView({ name: 'dashtopanelScrollview',
|
||||
hscrollbar_policy: Gtk.PolicyType.NEVER,
|
||||
vscrollbar_policy: Gtk.PolicyType.NEVER,
|
||||
hscrollbar_policy: St.PolicyType.NEVER,
|
||||
vscrollbar_policy: St.PolicyType.NEVER,
|
||||
enable_mouse_scrolling: true });
|
||||
|
||||
this._scrollView.connect('leave-event', this._onLeaveEvent.bind(this));
|
||||
@@ -312,9 +307,9 @@ export var Taskbar = class {
|
||||
}
|
||||
],
|
||||
[
|
||||
this._appSystem,
|
||||
'app-state-changed',
|
||||
this._queueRedisplay.bind(this)
|
||||
this._appSystem,
|
||||
'app-state-changed',
|
||||
this._queueRedisplay.bind(this)
|
||||
],
|
||||
[
|
||||
AppFavorites.getAppFavorites(),
|
||||
@@ -564,9 +559,11 @@ export var Taskbar = class {
|
||||
}
|
||||
|
||||
if (initial != this.fullScrollView && !this._waitIdleId) {
|
||||
this._waitIdleId = Mainloop.idle_add(() => {
|
||||
this._waitIdleId = GLib.idle_add(() => {
|
||||
this._getAppIcons().forEach(a => a.updateTitleStyle())
|
||||
this._waitIdleId = 0
|
||||
this._waitIdleId = 0;
|
||||
|
||||
return GLib.SOURCE_REMOVE;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1327,8 +1324,6 @@ export var Taskbar = class {
|
||||
}
|
||||
};
|
||||
|
||||
Signals.addSignalMethods(Taskbar.prototype);
|
||||
|
||||
const CloneContainerConstraint = GObject.registerClass({
|
||||
}, class CloneContainerConstraint extends Clutter.BindConstraint {
|
||||
|
||||
@@ -1344,7 +1339,7 @@ const CloneContainerConstraint = GObject.registerClass({
|
||||
}
|
||||
});
|
||||
|
||||
export var TaskbarItemContainer = GObject.registerClass({
|
||||
export const TaskbarItemContainer = GObject.registerClass({
|
||||
|
||||
}, class TaskbarItemContainer extends Dash.DashItemContainer {
|
||||
|
||||
@@ -1439,7 +1434,10 @@ export var TaskbarItemContainer = GObject.registerClass({
|
||||
this._raisedClone.connect('destroy', () => {
|
||||
adjustment.disconnect(adjustmentChangedId);
|
||||
taskbarBox.disconnect(taskbarBoxAllocationChangedId);
|
||||
Mainloop.idle_add(() => cloneContainer.destroy());
|
||||
GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
|
||||
cloneContainer.destroy();
|
||||
return GLib.SOURCE_REMOVE;
|
||||
});
|
||||
delete this._raisedClone;
|
||||
});
|
||||
|
||||
@@ -1532,7 +1530,7 @@ export var TaskbarItemContainer = GObject.registerClass({
|
||||
}
|
||||
});
|
||||
|
||||
var DragPlaceholderItem = GObject.registerClass({
|
||||
const DragPlaceholderItem = GObject.registerClass({
|
||||
}, class DragPlaceholderItem extends St.Widget {
|
||||
|
||||
_init(appIcon, iconSize, isVertical) {
|
||||
|
||||
@@ -15,19 +15,15 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GdkPixbuf from 'gi://GdkPixbuf';
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import Meta from 'gi://Meta';
|
||||
import St from 'gi://St';
|
||||
import * as Config from 'resource:///org/gnome/shell/misc/config.js';
|
||||
|
||||
import * as Panel from './panel.js';
|
||||
import * as Proximity from './proximity.js';
|
||||
import * as Utils from './utils.js';
|
||||
import {SETTINGS} from './extension.js';
|
||||
|
||||
export var DynamicTransparency = class {
|
||||
export const DynamicTransparency = class {
|
||||
|
||||
constructor(dtpPanel) {
|
||||
this._dtpPanel = dtpPanel;
|
||||
|
||||
139
utils.js
139
utils.js
@@ -26,23 +26,20 @@ import GdkPixbuf from 'gi://GdkPixbuf';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import Gtk from 'gi://Gtk';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as Config from 'resource:///org/gnome/shell/misc/config.js';
|
||||
import * as Util from 'resource:///org/gnome/shell/misc/util.js';
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js';
|
||||
|
||||
const Gi = imports._gi;
|
||||
const Mainloop = imports.mainloop;
|
||||
|
||||
var SCROLL_TIME = Util.SCROLL_TIME / (Util.SCROLL_TIME > 1 ? 1000 : 1);
|
||||
const SCROLL_TIME = Util.SCROLL_TIME / (Util.SCROLL_TIME > 1 ? 1000 : 1);
|
||||
|
||||
// simplify global signals and function injections handling
|
||||
// abstract class
|
||||
export var BasicHandler = class {
|
||||
export const BasicHandler = class {
|
||||
|
||||
constructor() {
|
||||
this._storage = new Object();
|
||||
@@ -102,7 +99,7 @@ export var BasicHandler = class {
|
||||
}
|
||||
|
||||
// Manage global signals
|
||||
export var GlobalSignalsHandler = class extends BasicHandler {
|
||||
export const GlobalSignalsHandler = class extends BasicHandler {
|
||||
|
||||
_create(item) {
|
||||
let handlers = [];
|
||||
@@ -135,7 +132,7 @@ export var GlobalSignalsHandler = class extends BasicHandler {
|
||||
* Manage function injection: both instances and prototype can be overridden
|
||||
* and restored
|
||||
*/
|
||||
export var InjectionsHandler = class extends BasicHandler {
|
||||
export const InjectionsHandler = class extends BasicHandler {
|
||||
|
||||
_create(item) {
|
||||
let object = item[0];
|
||||
@@ -158,7 +155,7 @@ export var InjectionsHandler = class extends BasicHandler {
|
||||
/**
|
||||
* Manage timeouts: the added timeouts have their id reset on completion
|
||||
*/
|
||||
export var TimeoutsHandler = class extends BasicHandler {
|
||||
export const TimeoutsHandler = class extends BasicHandler {
|
||||
|
||||
_create(item) {
|
||||
let name = item[0];
|
||||
@@ -167,9 +164,11 @@ export var TimeoutsHandler = class extends BasicHandler {
|
||||
|
||||
this._remove(item);
|
||||
|
||||
this[name] = Mainloop.timeout_add(delay, () => {
|
||||
this[name] = GLib.timeout_add(GLib.PRIORITY_DEFAULT, delay, () => {
|
||||
this[name] = 0;
|
||||
timeoutHandler();
|
||||
|
||||
return GLib.SOURCE_REMOVE;
|
||||
});
|
||||
|
||||
return [[name]];
|
||||
@@ -183,7 +182,7 @@ export var TimeoutsHandler = class extends BasicHandler {
|
||||
let name = item[0];
|
||||
|
||||
if (this[name]) {
|
||||
Mainloop.source_remove(this[name]);
|
||||
GLib.Source.remove(this[name]);
|
||||
this[name] = 0;
|
||||
}
|
||||
}
|
||||
@@ -195,7 +194,7 @@ export var TimeoutsHandler = class extends BasicHandler {
|
||||
|
||||
// This is wrapper to maintain compatibility with GNOME-Shell 3.30+ as well as
|
||||
// previous versions.
|
||||
export var DisplayWrapper = {
|
||||
export const DisplayWrapper = {
|
||||
getScreen() {
|
||||
return global.screen || global.display;
|
||||
},
|
||||
@@ -210,7 +209,7 @@ export var DisplayWrapper = {
|
||||
};
|
||||
|
||||
let unredirectEnabled = true
|
||||
export var setDisplayUnredirect = (enable) => {
|
||||
export const setDisplayUnredirect = (enable) => {
|
||||
if (enable && !unredirectEnabled)
|
||||
Meta.enable_unredirect_for_display(global.display);
|
||||
else if (!enable && unredirectEnabled)
|
||||
@@ -219,34 +218,34 @@ export var setDisplayUnredirect = (enable) => {
|
||||
unredirectEnabled = enable;
|
||||
};
|
||||
|
||||
export var getSystemMenuInfo = function() {
|
||||
export const getSystemMenuInfo = function() {
|
||||
return {
|
||||
name: 'quickSettings',
|
||||
constructor: Main.panel.statusArea.quickSettings.constructor
|
||||
};
|
||||
}
|
||||
|
||||
export var getCurrentWorkspace = function() {
|
||||
export const getCurrentWorkspace = function() {
|
||||
return DisplayWrapper.getWorkspaceManager().get_active_workspace();
|
||||
};
|
||||
|
||||
export var getWorkspaceByIndex = function(index) {
|
||||
export const getWorkspaceByIndex = function(index) {
|
||||
return DisplayWrapper.getWorkspaceManager().get_workspace_by_index(index);
|
||||
};
|
||||
|
||||
export var getWorkspaceCount = function() {
|
||||
export const getWorkspaceCount = function() {
|
||||
return DisplayWrapper.getWorkspaceManager().n_workspaces;
|
||||
};
|
||||
|
||||
export var getStageTheme = function() {
|
||||
export const getStageTheme = function() {
|
||||
return St.ThemeContext.get_for_stage(global.stage);
|
||||
};
|
||||
|
||||
export var getScaleFactor = function() {
|
||||
export const getScaleFactor = function() {
|
||||
return getStageTheme().scale_factor || 1;
|
||||
};
|
||||
|
||||
export var findIndex = function(array, predicate) {
|
||||
export const findIndex = function(array, predicate) {
|
||||
if (array) {
|
||||
if (Array.prototype.findIndex) {
|
||||
return array.findIndex(predicate);
|
||||
@@ -262,7 +261,7 @@ export var findIndex = function(array, predicate) {
|
||||
return -1;
|
||||
};
|
||||
|
||||
export var find = function(array, predicate) {
|
||||
export const find = function(array, predicate) {
|
||||
let index = findIndex(array, predicate);
|
||||
|
||||
if (index > -1) {
|
||||
@@ -270,8 +269,8 @@ export var find = function(array, predicate) {
|
||||
}
|
||||
};
|
||||
|
||||
export var mergeObjects = function(main, bck) {
|
||||
for (var prop in bck) {
|
||||
export const mergeObjects = function(main, bck) {
|
||||
for (const prop in bck) {
|
||||
if (!main.hasOwnProperty(prop) && bck.hasOwnProperty(prop)) {
|
||||
main[prop] = bck[prop];
|
||||
}
|
||||
@@ -280,7 +279,7 @@ export var mergeObjects = function(main, bck) {
|
||||
return main;
|
||||
};
|
||||
|
||||
export var hookVfunc = function(proto, symbol, func) {
|
||||
export const hookVfunc = function(proto, symbol, func) {
|
||||
if (!func) return
|
||||
|
||||
if (Gi.gobject_prototype_symbol && proto[Gi.gobject_prototype_symbol]) {
|
||||
@@ -290,14 +289,14 @@ export var hookVfunc = function(proto, symbol, func) {
|
||||
}
|
||||
};
|
||||
|
||||
export var getTrackedActorData = (actor) => {
|
||||
export const getTrackedActorData = (actor) => {
|
||||
let trackedIndex = Main.layoutManager._findActor(actor);
|
||||
|
||||
if (trackedIndex >= 0)
|
||||
return Main.layoutManager._trackedActors[trackedIndex]
|
||||
}
|
||||
|
||||
export var getTransformedAllocation = function(actor) {
|
||||
export const getTransformedAllocation = function(actor) {
|
||||
let extents = actor.get_transformed_extents();
|
||||
let topLeft = extents.get_top_left();
|
||||
let bottomRight = extents.get_bottom_right();
|
||||
@@ -305,13 +304,13 @@ export var getTransformedAllocation = function(actor) {
|
||||
return { x1: topLeft.x, x2: bottomRight.x, y1: topLeft.y, y2: bottomRight.y };
|
||||
};
|
||||
|
||||
export var setClip = function(actor, x, y, width, height) {
|
||||
export const setClip = function(actor, x, y, width, height) {
|
||||
actor.set_clip(0, 0, width, height);
|
||||
actor.set_position(x, y);
|
||||
actor.set_size(width, height);
|
||||
};
|
||||
|
||||
export var addKeybinding = function(key, settings, handler, modes) {
|
||||
export const addKeybinding = function(key, settings, handler, modes) {
|
||||
if (!Main.wm._allowedKeybindings[key]) {
|
||||
Main.wm.addKeybinding(
|
||||
key,
|
||||
@@ -323,19 +322,19 @@ export var addKeybinding = function(key, settings, handler, modes) {
|
||||
}
|
||||
};
|
||||
|
||||
export var removeKeybinding = function(key) {
|
||||
export const removeKeybinding = function(key) {
|
||||
if (Main.wm._allowedKeybindings[key]) {
|
||||
Main.wm.removeKeybinding(key);
|
||||
}
|
||||
};
|
||||
|
||||
export var getrgbColor = function(color) {
|
||||
export const getrgbColor = function(color) {
|
||||
color = typeof color === 'string' ? Clutter.color_from_string(color)[1] : color;
|
||||
|
||||
return { red: color.red, green: color.green, blue: color.blue };
|
||||
};
|
||||
|
||||
export var getrgbaColor = function(color, alpha, offset) {
|
||||
export const getrgbaColor = function(color, alpha, offset) {
|
||||
if (alpha <= 0) {
|
||||
return 'transparent; ';
|
||||
}
|
||||
@@ -355,14 +354,14 @@ export var getrgbaColor = function(color, alpha, offset) {
|
||||
return 'rgba(' + rgb.red + ',' + rgb.green + ',' + rgb.blue + ',' + (Math.floor(alpha * 100) * 0.01) + '); ' ;
|
||||
};
|
||||
|
||||
export var checkIfColorIsBright = function(color) {
|
||||
export const checkIfColorIsBright = function(color) {
|
||||
let rgb = getrgbColor(color);
|
||||
let brightness = 0.2126 * rgb.red + 0.7152 * rgb.green + 0.0722 * rgb.blue;
|
||||
|
||||
return brightness > 128;
|
||||
};
|
||||
|
||||
export var getMouseScrollDirection = function(event) {
|
||||
export const getMouseScrollDirection = function(event) {
|
||||
let direction;
|
||||
|
||||
switch (event.get_scroll_direction()) {
|
||||
@@ -379,7 +378,7 @@ export var getMouseScrollDirection = function(event) {
|
||||
return direction;
|
||||
};
|
||||
|
||||
export var checkIfWindowHasTransient = function(window) {
|
||||
export const checkIfWindowHasTransient = function(window) {
|
||||
let hasTransient;
|
||||
|
||||
window.foreach_transient(t => !(hasTransient = true));
|
||||
@@ -387,7 +386,7 @@ export var checkIfWindowHasTransient = function(window) {
|
||||
return hasTransient;
|
||||
};
|
||||
|
||||
export var activateSiblingWindow = function(windows, direction, startWindow) {
|
||||
export const activateSiblingWindow = function(windows, direction, startWindow) {
|
||||
let windowIndex = windows.indexOf(global.display.focus_window);
|
||||
let nextWindowIndex = windowIndex < 0 ?
|
||||
startWindow ? windows.indexOf(startWindow) : 0 :
|
||||
@@ -404,7 +403,7 @@ export var activateSiblingWindow = function(windows, direction, startWindow) {
|
||||
}
|
||||
};
|
||||
|
||||
export var animateWindowOpacity = function(window, tweenOpts) {
|
||||
export const animateWindowOpacity = function(window, tweenOpts) {
|
||||
//there currently is a mutter bug with the windowactor opacity, starting with 3.34
|
||||
//https://gitlab.gnome.org/GNOME/mutter/issues/836
|
||||
|
||||
@@ -433,7 +432,7 @@ export var animateWindowOpacity = function(window, tweenOpts) {
|
||||
animate(window, tweenOpts);
|
||||
};
|
||||
|
||||
export var animate = function(actor, options) {
|
||||
export const animate = function(actor, options) {
|
||||
//the original animations used Tweener instead of Clutter animations, so we
|
||||
//use "time" and "delay" properties defined in seconds, as opposed to Clutter
|
||||
//animations "duration" and "delay" which are defined in milliseconds
|
||||
@@ -466,15 +465,15 @@ export var animate = function(actor, options) {
|
||||
actor.ease.apply(actor, params);
|
||||
}
|
||||
|
||||
export var isAnimating = function(actor, prop) {
|
||||
export const isAnimating = function(actor, prop) {
|
||||
return !!actor.get_transition(prop);
|
||||
}
|
||||
|
||||
export var stopAnimations = function(actor) {
|
||||
export const stopAnimations = function(actor) {
|
||||
actor.remove_all_transitions();
|
||||
}
|
||||
|
||||
export var getIndicators = function(delegate) {
|
||||
export const getIndicators = function(delegate) {
|
||||
if (delegate instanceof St.BoxLayout) {
|
||||
return delegate;
|
||||
}
|
||||
@@ -482,11 +481,11 @@ export var getIndicators = function(delegate) {
|
||||
return delegate.indicators;
|
||||
}
|
||||
|
||||
export var getPoint = function(coords) {
|
||||
export const getPoint = function(coords) {
|
||||
return new Graphene.Point(coords);
|
||||
}
|
||||
|
||||
export var notify = function(text, iconName, action, isTransient) {
|
||||
export const notify = function(text, iconName, action, isTransient) {
|
||||
let source = new MessageTray.SystemNotificationSource();
|
||||
let notification = new MessageTray.Notification(source, 'Dash to Panel', text);
|
||||
let notifyFunc = source.showNotification || source.notify;
|
||||
@@ -517,7 +516,7 @@ export var notify = function(text, iconName, action, isTransient) {
|
||||
* it would be clamp to the current one in any case.
|
||||
* Return the amount of shift applied
|
||||
*/
|
||||
export var ensureActorVisibleInScrollView = function(scrollView, actor, fadeSize, onComplete) {
|
||||
export const ensureActorVisibleInScrollView = function(scrollView, actor, fadeSize, onComplete) {
|
||||
let vadjustment = scrollView.vscroll.adjustment;
|
||||
let hadjustment = scrollView.hscroll.adjustment;
|
||||
let [vvalue, vlower, vupper, vstepIncrement, vpageIncrement, vpageSize] = vadjustment.get_values();
|
||||
@@ -574,7 +573,7 @@ export var ensureActorVisibleInScrollView = function(scrollView, actor, fadeSize
|
||||
/**
|
||||
* ColorUtils is adapted from https://github.com/micheleg/dash-to-dock
|
||||
*/
|
||||
export var ColorUtils = {
|
||||
export const ColorUtils = {
|
||||
colorLuminance(r, g, b, dlum) {
|
||||
// Darken or brighten color by a fraction dlum
|
||||
// Each rgb value is modified by the same fraction.
|
||||
@@ -685,7 +684,7 @@ const MAX_CACHED_ITEMS = 1000;
|
||||
const BATCH_SIZE_TO_DELETE = 50;
|
||||
const DOMINANT_COLOR_ICON_SIZE = 64;
|
||||
|
||||
export var DominantColorExtractor = class {
|
||||
export const DominantColorExtractor = class {
|
||||
|
||||
constructor(app){
|
||||
this._app = app;
|
||||
@@ -696,14 +695,9 @@ export var DominantColorExtractor = class {
|
||||
*/
|
||||
_getIconPixBuf() {
|
||||
let iconTexture = this._app.create_icon_texture(16);
|
||||
let isGtk3 = !!Gtk.IconTheme.prototype.set_custom_theme;
|
||||
|
||||
if (themeLoader === null) {
|
||||
let ifaceSettings = new Gio.Settings({ schema: "org.gnome.desktop.interface" });
|
||||
let themeFunc = isGtk3 ? 'set_custom_theme' : 'set_theme_name';
|
||||
|
||||
themeLoader = new Gtk.IconTheme(),
|
||||
themeLoader[themeFunc](ifaceSettings.get_string('icon-theme')); // Make sure the correct theme is loaded
|
||||
themeLoader = new St.IconTheme();
|
||||
}
|
||||
|
||||
// Unable to load the icon texture, use fallback
|
||||
@@ -725,19 +719,11 @@ export var DominantColorExtractor = class {
|
||||
|
||||
// Get the pixel buffer from the icon theme
|
||||
if (iconTexture instanceof Gio.ThemedIcon) {
|
||||
let params = [iconTexture.get_names()[0], DOMINANT_COLOR_ICON_SIZE, 0];
|
||||
|
||||
if (!isGtk3) {
|
||||
params.splice(1, 0, null);
|
||||
params.splice(3, 1, 1, 1, 1);
|
||||
}
|
||||
|
||||
let icon_info = themeLoader.lookup_icon.apply(themeLoader, params);
|
||||
let icon_info = themeLoader.lookup_icon(iconTexture.get_names()[0],
|
||||
DOMINANT_COLOR_ICON_SIZE, 0);
|
||||
|
||||
if (icon_info !== null) {
|
||||
if (isGtk3) return icon_info.load_icon();
|
||||
|
||||
return GdkPixbuf.Pixbuf.new_from_file(icon_info.get_file().get_path());
|
||||
return icon_info.load_icon();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -875,7 +861,7 @@ export var DominantColorExtractor = class {
|
||||
|
||||
};
|
||||
|
||||
export var drawRoundedLine = function(cr, x, y, width, height, isRoundLeft, isRoundRight, stroke, fill) {
|
||||
export const drawRoundedLine = function(cr, x, y, width, height, isRoundLeft, isRoundRight, stroke, fill) {
|
||||
if (height > width) {
|
||||
y += Math.floor((height - width) / 2.0);
|
||||
height = width;
|
||||
@@ -883,8 +869,8 @@ export var drawRoundedLine = function(cr, x, y, width, height, isRoundLeft, isRo
|
||||
|
||||
height = 2.0 * Math.floor(height / 2.0);
|
||||
|
||||
var leftRadius = isRoundLeft ? height / 2.0 : 0.0;
|
||||
var rightRadius = isRoundRight ? height / 2.0 : 0.0;
|
||||
const leftRadius = isRoundLeft ? height / 2.0 : 0.0;
|
||||
const rightRadius = isRoundRight ? height / 2.0 : 0.0;
|
||||
|
||||
cr.moveTo(x + width - rightRadius, y);
|
||||
cr.lineTo(x + leftRadius, y);
|
||||
@@ -907,28 +893,3 @@ export var drawRoundedLine = function(cr, x, y, width, height, isRoundLeft, isRo
|
||||
cr.setSource(stroke);
|
||||
cr.stroke();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an app exists in the system.
|
||||
*/
|
||||
var checkedCommandsMap = new Map();
|
||||
|
||||
export function checkIfCommandExists(app) {
|
||||
let answer = checkedCommandsMap.get(app);
|
||||
if (answer === undefined) {
|
||||
// Command is a shell built in, use shell to call it.
|
||||
// Quotes around app value are important. They let command operate
|
||||
// on the whole value, instead of having shell interpret it.
|
||||
let cmd = "sh -c 'command -v \"" + app + "\"'";
|
||||
try {
|
||||
let out = GLib.spawn_command_line_sync(cmd);
|
||||
// out contains 1: stdout, 2: stderr, 3: exit code
|
||||
answer = out[3] == 0;
|
||||
} catch (ex) {
|
||||
answer = false;
|
||||
}
|
||||
|
||||
checkedCommandsMap.set(app, answer);
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
|
||||
@@ -19,21 +19,15 @@ import GObject from 'gi://GObject';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import Gtk from 'gi://Gtk';
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import Meta from 'gi://Meta';
|
||||
import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
|
||||
import St from 'gi://St';
|
||||
import * as WindowManager from 'resource:///org/gnome/shell/ui/windowManager.js';
|
||||
import * as Workspace from 'resource:///org/gnome/shell/ui/workspace.js';
|
||||
|
||||
import * as Panel from './panel.js';
|
||||
import * as Taskbar from './taskbar.js';
|
||||
import * as Utils from './utils.js';
|
||||
import {SETTINGS, DESKTOPSETTINGS} from './extension.js';
|
||||
|
||||
const Mainloop = imports.mainloop;
|
||||
const {signals: Signals} = imports;
|
||||
import {gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
|
||||
//timeout intervals
|
||||
const ENSURE_VISIBLE_MS = 200;
|
||||
@@ -62,7 +56,7 @@ let scaleFactor = 1;
|
||||
let animationTime = 0;
|
||||
let aspectRatio = {};
|
||||
|
||||
export var PreviewMenu = GObject.registerClass({
|
||||
export const PreviewMenu = GObject.registerClass({
|
||||
Signals: { 'open-state-changed': {} }
|
||||
}, class PreviewMenu extends St.Widget {
|
||||
|
||||
@@ -95,8 +89,8 @@ export var PreviewMenu = GObject.registerClass({
|
||||
this._box = new St.BoxLayout({ vertical: this.isVertical });
|
||||
this._scrollView = new St.ScrollView({
|
||||
name: 'dashtopanelPreviewScrollview',
|
||||
hscrollbar_policy: Gtk.PolicyType.NEVER,
|
||||
vscrollbar_policy: Gtk.PolicyType.NEVER,
|
||||
hscrollbar_policy: St.PolicyType.NEVER,
|
||||
vscrollbar_policy: St.PolicyType.NEVER,
|
||||
enable_mouse_scrolling: true,
|
||||
y_expand: !this.isVertical
|
||||
});
|
||||
@@ -694,7 +688,7 @@ export var PreviewMenu = GObject.registerClass({
|
||||
}
|
||||
});
|
||||
|
||||
export var Preview = GObject.registerClass({
|
||||
export const Preview = GObject.registerClass({
|
||||
}, class Preview extends St.Widget {
|
||||
|
||||
_init(previewMenu) {
|
||||
@@ -811,12 +805,14 @@ export var Preview = GObject.registerClass({
|
||||
this._addClone(cloneBin, animateSize);
|
||||
this._previewMenu.updatePosition();
|
||||
} else if (!this._waitWindowId) {
|
||||
this._waitWindowId = Mainloop.idle_add(() => {
|
||||
this._waitWindowId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
|
||||
this._waitWindowId = 0;
|
||||
|
||||
if (this._previewMenu.opened) {
|
||||
_assignWindowClone();
|
||||
}
|
||||
|
||||
return GLib.SOURCE_REMOVE;
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -1112,7 +1108,7 @@ export var Preview = GObject.registerClass({
|
||||
}
|
||||
});
|
||||
|
||||
export var WindowCloneLayout = GObject.registerClass({
|
||||
export const WindowCloneLayout = GObject.registerClass({
|
||||
}, class WindowCloneLayout extends Clutter.BinLayout {
|
||||
|
||||
_init(frameRect, bufferRect) {
|
||||
|
||||
Reference in New Issue
Block a user