mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 16:24:03 +09:00
refactor: avoid using var
This commit is contained in:
10
appIcons.js
10
appIcons.js
@@ -1412,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 + ')';
|
||||
}
|
||||
@@ -1851,7 +1851,7 @@ export const 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(' ')
|
||||
|
||||
@@ -42,7 +42,7 @@ 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 const Hold = {
|
||||
NONE: 0,
|
||||
|
||||
2
panel.js
2
panel.js
@@ -1223,7 +1223,7 @@ export const 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, () => {}]);
|
||||
|
||||
4
prefs.js
4
prefs.js
@@ -142,7 +142,7 @@ 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];
|
||||
}
|
||||
@@ -1933,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]);
|
||||
|
||||
@@ -47,7 +47,7 @@ import {SETTINGS} from './extension.js';
|
||||
const SearchController = Main.overview.searchController;
|
||||
|
||||
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;
|
||||
const DASH_ITEM_HOVER_TIMEOUT = Dash.DASH_ITEM_HOVER_TIMEOUT;
|
||||
export const MIN_ICON_SIZE = 4;
|
||||
|
||||
const T1 = 'ensureAppIconVisibilityTimeout'
|
||||
@@ -1530,7 +1530,7 @@ export const TaskbarItemContainer = GObject.registerClass({
|
||||
}
|
||||
});
|
||||
|
||||
var DragPlaceholderItem = GObject.registerClass({
|
||||
const DragPlaceholderItem = GObject.registerClass({
|
||||
}, class DragPlaceholderItem extends St.Widget {
|
||||
|
||||
_init(appIcon, iconSize, isVertical) {
|
||||
|
||||
8
utils.js
8
utils.js
@@ -35,7 +35,7 @@ import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js';
|
||||
|
||||
const Gi = imports._gi;
|
||||
|
||||
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
|
||||
@@ -270,7 +270,7 @@ export const find = function(array, predicate) {
|
||||
};
|
||||
|
||||
export const mergeObjects = function(main, bck) {
|
||||
for (var prop in bck) {
|
||||
for (const prop in bck) {
|
||||
if (!main.hasOwnProperty(prop) && bck.hasOwnProperty(prop)) {
|
||||
main[prop] = bck[prop];
|
||||
}
|
||||
@@ -869,8 +869,8 @@ export const drawRoundedLine = function(cr, x, y, width, height, isRoundLeft, is
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user