mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
refactor: replace export var with export const
This commit is contained in:
10
appIcons.js
10
appIcons.js
@@ -68,7 +68,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 +108,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) {
|
||||
@@ -1587,7 +1587,7 @@ export function ItemShowLabel() {
|
||||
* use of this class in place of the original showAppsButton.
|
||||
*
|
||||
*/
|
||||
export var ShowAppsIconWrapper = class {
|
||||
export const ShowAppsIconWrapper = class {
|
||||
|
||||
constructor(dtpPanel) {
|
||||
this.realShowAppsIcon = new Dash.ShowAppsIcon();
|
||||
@@ -1736,7 +1736,7 @@ 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());
|
||||
@@ -1875,7 +1875,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;
|
||||
|
||||
12
extension.js
12
extension.js
@@ -43,12 +43,12 @@ let extensionChangedHandler;
|
||||
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) {
|
||||
|
||||
@@ -45,13 +45,13 @@ const T4 = 'panelBoxClipTimeout';
|
||||
|
||||
var 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 +424,4 @@ export var Intellihide = class {
|
||||
|
||||
this._hoveredOut = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,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 +518,4 @@ export var Overview = class {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
8
panel.js
8
panel.js
@@ -63,7 +63,7 @@ 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 +72,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) {
|
||||
@@ -1256,7 +1256,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 +1266,4 @@ export var SecondaryPanel = GObject.registerClass({
|
||||
vfunc_allocate(box) {
|
||||
this.set_allocation(box);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -56,7 +56,7 @@ import {SecondaryMonitorDisplay, WorkspacesView} from 'resource:///org/gnome/she
|
||||
|
||||
const Gi = imports._gi;
|
||||
|
||||
export var PanelManager = class {
|
||||
export const PanelManager = class {
|
||||
|
||||
constructor() {
|
||||
this.overview = new Overview.Overview();
|
||||
@@ -529,7 +529,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import {SETTINGS} from './extension.js';
|
||||
|
||||
const Mainloop = imports.mainloop;
|
||||
|
||||
export var PanelStyle = class {
|
||||
export const PanelStyle = class {
|
||||
|
||||
enable(panel) {
|
||||
this.panel = panel;
|
||||
|
||||
@@ -30,7 +30,7 @@ const Cairo = imports.cairo;
|
||||
const {signals: Signals} = imports;
|
||||
|
||||
|
||||
export var ProgressManager = class {
|
||||
export const ProgressManager = class {
|
||||
|
||||
constructor() {
|
||||
this._entriesByDBusName = {};
|
||||
@@ -281,7 +281,7 @@ export class AppProgress {
|
||||
Signals.addSignalMethods(AppProgress.prototype);
|
||||
|
||||
|
||||
export var ProgressIndicator = class {
|
||||
export const ProgressIndicator = class {
|
||||
|
||||
constructor(source, progressManager) {
|
||||
this._source = source;
|
||||
|
||||
@@ -29,7 +29,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 +66,7 @@ export class ProximityWatch {
|
||||
}
|
||||
};
|
||||
|
||||
export var ProximityManager = class {
|
||||
export const ProximityManager = class {
|
||||
|
||||
constructor() {
|
||||
this._counter = 1;
|
||||
@@ -254,4 +254,4 @@ export var ProximityManager = class {
|
||||
metaWindow.get_monitor() == watch.monitorIndex ||
|
||||
windowRect.overlap(global.display.get_monitor_geometry(watch.monitorIndex)));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
10
taskbar.js
10
taskbar.js
@@ -53,9 +53,9 @@ 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);
|
||||
export const 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 MIN_ICON_SIZE = 4;
|
||||
|
||||
const T1 = 'ensureAppIconVisibilityTimeout'
|
||||
const T2 = 'showLabelTimeout'
|
||||
@@ -119,7 +119,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,7 +200,7 @@ export var TaskbarActor = GObject.registerClass({
|
||||
* - Sync minimization application target position.
|
||||
*/
|
||||
|
||||
export var Taskbar = class {
|
||||
export const Taskbar = class {
|
||||
|
||||
constructor(panel) {
|
||||
this.dtpPanel = panel;
|
||||
@@ -1344,7 +1344,7 @@ const CloneContainerConstraint = GObject.registerClass({
|
||||
}
|
||||
});
|
||||
|
||||
export var TaskbarItemContainer = GObject.registerClass({
|
||||
export const TaskbarItemContainer = GObject.registerClass({
|
||||
|
||||
}, class TaskbarItemContainer extends Dash.DashItemContainer {
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ 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;
|
||||
|
||||
76
utils.js
76
utils.js
@@ -42,7 +42,7 @@ var 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 +102,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 +135,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 +158,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];
|
||||
@@ -195,7 +195,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 +210,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 +219,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 +262,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,7 +270,7 @@ export var find = function(array, predicate) {
|
||||
}
|
||||
};
|
||||
|
||||
export var mergeObjects = function(main, bck) {
|
||||
export const mergeObjects = function(main, bck) {
|
||||
for (var prop in bck) {
|
||||
if (!main.hasOwnProperty(prop) && bck.hasOwnProperty(prop)) {
|
||||
main[prop] = bck[prop];
|
||||
@@ -280,7 +280,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 +290,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 +305,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 +323,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 +355,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 +379,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 +387,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 +404,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 +433,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 +466,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 +482,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 +517,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 +574,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 +685,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;
|
||||
@@ -875,7 +875,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;
|
||||
|
||||
@@ -62,7 +62,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 {
|
||||
|
||||
@@ -694,7 +694,7 @@ export var PreviewMenu = GObject.registerClass({
|
||||
}
|
||||
});
|
||||
|
||||
export var Preview = GObject.registerClass({
|
||||
export const Preview = GObject.registerClass({
|
||||
}, class Preview extends St.Widget {
|
||||
|
||||
_init(previewMenu) {
|
||||
@@ -1112,7 +1112,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