Compare commits

...

5 Commits

Author SHA1 Message Date
Florian Müllner
01d3d8fd6d Bump version to 43.rc
Update NEWS.
2022-09-04 15:25:43 +02:00
Florian Müllner
47c2834ffa Update sass submodule 2022-09-04 15:24:50 +02:00
Florian Müllner
9f88e98d1b extensions: Stop monkey-patching signal methods
gnome-shell added an EventEmitter class that can be used as base
for any non-GObject class that needs to emit signals.

Use that instead of the old monkey-patching.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/240>
2022-08-20 19:03:36 +02:00
Florian Müllner
4b7055d0da places-menu: Mark PlacesManager as exported
For some reason eslint failed to complain about this.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/240>
2022-08-20 19:03:36 +02:00
Florian Müllner
563d7770d3 lint: Sync with gnome-shell
gnome-shell started transitioning to gjs' object spacing rule,
i.e. `{foo: 42}` instead of `{ foo: 42 }`.

We have a much smaller code base than the shell and aren't using
a secondary "allowed-but-deprecated" configuration that allows a
gradual transition, so just pull the switch and update to the new
style.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/240>
2022-08-20 19:00:32 +02:00
22 changed files with 103 additions and 91 deletions

7
NEWS
View File

@@ -1,3 +1,10 @@
43.rc
=====
* Misc. bug fixes and cleanups [Florian; !240]
Contributors:
Florian Müllner
43.beta
=======
* Misc. bug fixes and cleanups [Florian; !237, !238]

View File

@@ -4,7 +4,7 @@
const {
Atk, Clutter, Gio, GLib, GMenu, GObject, Gtk, Meta, Shell, St,
} = imports.gi;
const Signals = imports.signals;
const {EventEmitter} = imports.misc.signals;
const DND = imports.ui.dnd;
const ExtensionUtils = imports.misc.extensionUtils;
@@ -117,7 +117,7 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
else
name = _('Favorites');
this.add_child(new St.Label({ text: name }));
this.add_child(new St.Label({text: name}));
this.connect('motion-event', this._onMotionEvent.bind(this));
this.connect('notify::active', this._onActiveChanged.bind(this));
}
@@ -239,8 +239,10 @@ class ApplicationsMenu extends PopupMenu.PopupMenu {
}
}
class DesktopTarget {
class DesktopTarget extends EventEmitter {
constructor() {
super();
this._desktop = null;
this._desktopDestroyedId = 0;
@@ -357,7 +359,6 @@ class DesktopTarget {
return true;
}
}
Signals.addSignalMethods(DesktopTarget.prototype);
class ApplicationsButton extends PanelMenu.Button {
static {
@@ -408,7 +409,7 @@ class ApplicationsButton extends PanelMenu.Button {
});
});
this._tree = new GMenu.Tree({ menu_basename: 'applications.menu' });
this._tree = new GMenu.Tree({menu_basename: 'applications.menu'});
this._treeChangedId = this._tree.connect('changed',
this._onTreeChanged.bind(this));
@@ -509,7 +510,7 @@ class ApplicationsButton extends PanelMenu.Button {
}
let app = appSys.lookup_app(id);
if (!app)
app = new Shell.App({ app_info: entry.get_app_info() });
app = new Shell.App({app_info: entry.get_app_info()});
if (app.get_app_info().should_show())
this.applicationsByCategory[categoryId].push(app);
} else if (nextType === GMenu.TreeItemType.SEPARATOR) {
@@ -555,8 +556,8 @@ class ApplicationsButton extends PanelMenu.Button {
_createLayout() {
let section = new PopupMenu.PopupMenuSection();
this.menu.addMenuItem(section);
this.mainBox = new St.BoxLayout({ vertical: false });
this.leftBox = new St.BoxLayout({ vertical: true });
this.mainBox = new St.BoxLayout({vertical: false});
this.leftBox = new St.BoxLayout({vertical: true});
this.applicationsScrollBox = new St.ScrollView({
style_class: 'apps-menu vfade',
x_expand: true,
@@ -578,9 +579,9 @@ class ApplicationsButton extends PanelMenu.Button {
vscroll.connect('scroll-stop', () => (this.menu.passEvents = false));
this.leftBox.add_child(this.categoriesScrollBox);
this.applicationsBox = new St.BoxLayout({ vertical: true });
this.applicationsBox = new St.BoxLayout({vertical: true});
this.applicationsScrollBox.add_actor(this.applicationsBox);
this.categoriesBox = new St.BoxLayout({ vertical: true });
this.categoriesBox = new St.BoxLayout({vertical: true});
this.categoriesScrollBox.add_actor(this.categoriesBox);
this.mainBox.add(this.leftBox);

View File

@@ -2,7 +2,7 @@
// Start apps on custom workspaces
/* exported init enable disable */
const { Shell } = imports.gi;
const {Shell} = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;

View File

@@ -2,7 +2,7 @@
// Start apps on custom workspaces
/* exported init buildPrefsWidget */
const { Adw, Gio, GLib, GObject, Gtk } = imports.gi;
const {Adw, Gio, GLib, GObject, Gtk} = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
@@ -75,7 +75,7 @@ class RulesList extends GObject.Object {
append(appInfo) {
const pos = this.#rules.length;
this.#rules.push(new Rule({ appInfo }));
this.#rules.push(new Rule({appInfo}));
this.#saveRules();
this.items_changed(pos, 0, 1);
@@ -97,7 +97,7 @@ class RulesList extends GObject.Object {
if (pos < 0)
return;
this.#rules[pos].set({ workspace });
this.#rules[pos].set({workspace});
this.#saveRules();
}
@@ -116,7 +116,7 @@ class RulesList extends GObject.Object {
const [id, workspace] = stringRule.split(':');
const appInfo = Gio.DesktopAppInfo.new(id);
if (appInfo)
this.#rules.push(new Rule({ appInfo, workspace }));
this.#rules.push(new Rule({appInfo, workspace}));
else
log(`Invalid ID ${id}`);
}
@@ -154,8 +154,8 @@ class AutoMoveSettingsWidget extends Adw.PreferencesGroup {
this._rules = new RulesList();
const store = new Gio.ListStore({ item_type: Gio.ListModel });
const listModel = new Gtk.FlattenListModel({ model: store });
const store = new Gio.ListStore({item_type: Gio.ListModel});
const listModel = new Gtk.FlattenListModel({model: store});
store.append(this._rules);
store.append(new NewItemModel());
@@ -248,7 +248,7 @@ class RuleRow extends Adw.ActionRow {
}
constructor(rule) {
const { appInfo } = rule;
const {appInfo} = rule;
const id = appInfo.get_id();
super({

View File

@@ -1,6 +1,6 @@
/* exported init enable disable */
// Drive menu extension
const { Clutter, Gio, GObject, Shell, St } = imports.gi;
const {Clutter, Gio, GObject, Shell, St} = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;

View File

@@ -1,10 +1,10 @@
// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*-
/* exported enable disable */
const { Clutter } = imports.gi;
const {Clutter} = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;
const { WindowPreview } = imports.ui.windowPreview;
const {WindowPreview} = imports.ui.windowPreview;
const Workspace = imports.ui.workspace;
// testing settings for natural window placement strategy:

View File

@@ -1,7 +1,7 @@
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
/* exported init enable disable */
const { Clutter, GObject, St } = imports.gi;
const {Clutter, GObject, St} = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;

View File

@@ -1,7 +1,8 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported PlacesManager */
const { Gio, GLib, Shell } = imports.gi;
const Signals = imports.signals;
const {Gio, GLib, Shell} = imports.gi;
const {EventEmitter} = imports.misc.signals;
const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;
@@ -22,8 +23,10 @@ const Hostname1Iface = '<node> \
</node>';
const Hostname1 = Gio.DBusProxy.makeProxyWrapper(Hostname1Iface);
class PlaceInfo {
class PlaceInfo extends EventEmitter {
constructor(...params) {
super();
this._init(...params);
}
@@ -31,7 +34,7 @@ class PlaceInfo {
this.kind = kind;
this.file = file;
this.name = name || this._getFileName();
this.icon = icon ? new Gio.ThemedIcon({ name: icon }) : this.getIcon();
this.icon = icon ? new Gio.ThemedIcon({name: icon}) : this.getIcon();
}
destroy() {
@@ -94,16 +97,16 @@ class PlaceInfo {
// icon from the query info above
switch (this.kind) {
case 'network':
return new Gio.ThemedIcon({ name: 'folder-remote-symbolic' });
return new Gio.ThemedIcon({name: 'folder-remote-symbolic'});
case 'devices':
return new Gio.ThemedIcon({ name: 'drive-harddisk-symbolic' });
return new Gio.ThemedIcon({name: 'drive-harddisk-symbolic'});
case 'special':
case 'bookmarks':
default:
if (!this.file.is_native())
return new Gio.ThemedIcon({ name: 'folder-remote-symbolic' });
return new Gio.ThemedIcon({name: 'folder-remote-symbolic'});
else
return new Gio.ThemedIcon({ name: 'folder-symbolic' });
return new Gio.ThemedIcon({name: 'folder-symbolic'});
}
}
@@ -118,7 +121,6 @@ class PlaceInfo {
}
}
}
Signals.addSignalMethods(PlaceInfo.prototype);
class RootInfo extends PlaceInfo {
_init() {
@@ -138,7 +140,7 @@ class RootInfo extends PlaceInfo {
}
getIcon() {
return new Gio.ThemedIcon({ name: 'drive-harddisk-symbolic' });
return new Gio.ThemedIcon({name: 'drive-harddisk-symbolic'});
}
_propertiesChanged(proxy) {
@@ -246,8 +248,10 @@ const DEFAULT_DIRECTORIES = [
GLib.UserDirectory.DIRECTORY_VIDEOS,
];
var PlacesManager = class {
var PlacesManager = class extends EventEmitter {
constructor() {
super();
this._places = {
special: [],
devices: [],
@@ -255,7 +259,7 @@ var PlacesManager = class {
network: [],
};
this._settings = new Gio.Settings({ schema_id: BACKGROUND_SCHEMA });
this._settings = new Gio.Settings({schema_id: BACKGROUND_SCHEMA});
this._showDesktopIconsChangedId = this._settings.connect(
'changed::show-desktop-icons', this._updateSpecials.bind(this));
this._updateSpecials();
@@ -543,4 +547,3 @@ var PlacesManager = class {
return this._places[kind];
}
};
Signals.addSignalMethods(PlacesManager.prototype);

View File

@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
const { Clutter, Meta, Shell, St } = imports.gi;
const {Clutter, Meta, Shell, St} = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;
@@ -39,7 +39,7 @@ function hideMessage() {
*/
function flashMessage(message) {
if (!text) {
text = new St.Label({ style_class: 'screenshot-sizer-message' });
text = new St.Label({style_class: 'screenshot-sizer-message'});
Main.uiGroup.add_actor(text);
}
@@ -132,7 +132,7 @@ function cycleScreenshotSizes(display, window, binding) {
* @param {Meta.Window} window - the window whose size changed
*/
function _notifySizeChange(window) {
const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage);
let newOuterRect = window.get_frame_rect();
let message = '%d×%d'.format(
newOuterRect.width / scaleFactor,

View File

@@ -2,7 +2,7 @@
// Load shell theme from ~/.local/share/themes/name/gnome-shell
/* exported init */
const { Gio } = imports.gi;
const {Gio} = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;

View File

@@ -4,7 +4,7 @@
// we use async/await here to not block the mainloop, not to parallelize
/* eslint-disable no-await-in-loop */
const { Adw, Gio, GLib, GObject, Gtk } = imports.gi;
const {Adw, Gio, GLib, GObject, Gtk} = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
@@ -21,7 +21,7 @@ class UserThemePrefsWidget extends Adw.PreferencesGroup {
}
constructor() {
super({ title: 'Themes' });
super({title: 'Themes'});
this._actionGroup = new Gio.SimpleActionGroup();
this.insert_action_group('theme', this._actionGroup);

View File

@@ -1,5 +1,5 @@
/* exported getThemeDirs getModeThemeDirs */
const { GLib } = imports.gi;
const {GLib} = imports.gi;
const fn = (...args) => GLib.build_filenamev(args);

View File

@@ -1,5 +1,5 @@
/* exported init */
const { Clutter, Gio, GLib, GObject, Gtk, Meta, Shell, St } = imports.gi;
const {Clutter, Gio, GLib, GObject, Gtk, Meta, Shell, St} = imports.gi;
const DND = imports.ui.dnd;
const ExtensionUtils = imports.misc.extensionUtils;
@@ -8,8 +8,8 @@ const Overview = imports.ui.overview;
const PopupMenu = imports.ui.popupMenu;
const Me = ExtensionUtils.getCurrentExtension();
const { WindowPicker, WindowPickerToggle } = Me.imports.windowPicker;
const { WorkspaceIndicator } = Me.imports.workspaceIndicator;
const {WindowPicker, WindowPickerToggle} = Me.imports.windowPicker;
const {WorkspaceIndicator} = Me.imports.workspaceIndicator;
const _ = ExtensionUtils.gettext;
@@ -120,9 +120,9 @@ class WindowTitle extends St.BoxLayout {
this._metaWindow = metaWindow;
this._icon = new St.Bin({ style_class: 'window-button-icon' });
this._icon = new St.Bin({style_class: 'window-button-icon'});
this.add(this._icon);
this.label_actor = new St.Label({ y_align: Clutter.ActorAlign.CENTER });
this.label_actor = new St.Label({y_align: Clutter.ActorAlign.CENTER});
this.label_actor.clutter_text.single_line_mode = true;
this.add(this.label_actor);
@@ -250,7 +250,7 @@ class BaseButton extends St.Button {
if (this._longPressTimeoutId)
return;
const { longPressDuration } = Clutter.Settings.get_default();
const {longPressDuration} = Clutter.Settings.get_default();
this._longPressTimeoutId =
GLib.timeout_add(GLib.PRIORITY_DEFAULT, longPressDuration, () => {
delete this._longPressTimeoutId;
@@ -543,7 +543,7 @@ class AppButton extends BaseButton {
this.app = app;
this._updateVisibility();
let stack = new St.Widget({ layout_manager: new Clutter.BinLayout() });
let stack = new St.Widget({layout_manager: new Clutter.BinLayout()});
this.set_child(stack);
this._singleWindowTitle = new St.Bin({
@@ -742,7 +742,7 @@ class WindowList extends St.Widget {
this._perMonitor = perMonitor;
this._monitor = monitor;
let box = new St.BoxLayout({ x_expand: true, y_expand: true });
let box = new St.BoxLayout({x_expand: true, y_expand: true});
this.add_actor(box);
let toggle = new WindowPickerToggle();
@@ -751,7 +751,7 @@ class WindowList extends St.Widget {
toggle.connect('notify::checked',
this._updateWindowListVisibility.bind(this));
let layout = new Clutter.BoxLayout({ homogeneous: true });
let layout = new Clutter.BoxLayout({homogeneous: true});
this._windowList = new St.Widget({
style_class: 'window-list',
reactive: true,
@@ -769,13 +769,13 @@ class WindowList extends St.Widget {
});
this._windowList.connect('scroll-event', this._onScrollEvent.bind(this));
let indicatorsBox = new St.BoxLayout({ x_align: Clutter.ActorAlign.END });
let indicatorsBox = new St.BoxLayout({x_align: Clutter.ActorAlign.END});
box.add(indicatorsBox);
this._workspaceIndicator = new WorkspaceIndicator();
indicatorsBox.add_child(this._workspaceIndicator.container);
this._mutterSettings = new Gio.Settings({ schema_id: 'org.gnome.mutter' });
this._mutterSettings = new Gio.Settings({schema_id: 'org.gnome.mutter'});
this._workspacesOnlyOnPrimaryChangedId = this._mutterSettings.connect(
'changed::workspaces-only-on-primary',
this._updateWorkspaceIndicatorVisibility.bind(this));
@@ -918,7 +918,7 @@ class WindowList extends St.Widget {
let children = this._windowList.get_children();
let [, childWidth] = children[0].get_preferred_width(-1);
let { spacing } = this._windowList.layout_manager;
let {spacing} = this._windowList.layout_manager;
let workspace = global.workspace_manager.get_active_workspace();
let windows = global.display.get_tab_list(Meta.TabList.NORMAL, workspace);

View File

@@ -1,7 +1,7 @@
// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*-
/* exported init buildPrefsWidget */
const { Adw, Gio, GLib, GObject, Gtk } = imports.gi;
const {Adw, Gio, GLib, GObject, Gtk} = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
@@ -37,12 +37,12 @@ class WindowListPrefsWidget extends Adw.PreferencesPage {
this.add(groupingGroup);
const modes = [
{ mode: 'never', title: _('Never group windows') },
{ mode: 'auto', title: _('Group windows when space is limited') },
{ mode: 'always', title: _('Always group windows') },
{mode: 'never', title: _('Never group windows')},
{mode: 'auto', title: _('Group windows when space is limited')},
{mode: 'always', title: _('Always group windows')},
];
for (const { mode, title } of modes) {
for (const {mode, title} of modes) {
const check = new Gtk.CheckButton({
action_name: 'window-list.grouping-mode',
action_target: new GLib.Variant('s', mode),

View File

@@ -1,12 +1,12 @@
/* exported WindowPicker, WindowPickerToggle */
const { Clutter, GObject, Shell, St } = imports.gi;
const {Clutter, GObject, Shell, St} = imports.gi;
const Layout = imports.ui.layout;
const Main = imports.ui.main;
const { WorkspacesDisplay } = imports.ui.workspacesView;
const {WorkspacesDisplay} = imports.ui.workspacesView;
const Workspace = imports.ui.workspace;
const { VIGNETTE_BRIGHTNESS } = imports.ui.lightbox;
const {VIGNETTE_BRIGHTNESS} = imports.ui.lightbox;
const {
SIDE_CONTROLS_ANIMATION_TIME,
OverviewAdjustment,
@@ -90,7 +90,7 @@ class MyWorkspace extends Workspace.Workspace {
this._adjChangedId =
this._overviewAdjustment.connect('notify::value', () => {
const { value: progress } = this._overviewAdjustment;
const {value: progress} = this._overviewAdjustment;
const brightness = 1 - (1 - VIGNETTE_BRIGHTNESS) * progress;
for (const bg of this._background?._backgroundGroup ?? []) {
bg.content.set({
@@ -151,7 +151,7 @@ class MyWorkspaceBackground extends Workspace.WorkspaceBackground {
var WindowPicker = class WindowPicker extends Clutter.Actor {
static [GObject.signals] = {
'open-state-changed': { param_types: [GObject.TYPE_BOOLEAN] },
'open-state-changed': {param_types: [GObject.TYPE_BOOLEAN]},
};
static {
@@ -159,7 +159,7 @@ var WindowPicker = class WindowPicker extends Clutter.Actor {
}
constructor() {
super({ reactive: true });
super({reactive: true});
this._visible = false;
this._modal = false;

View File

@@ -1,5 +1,5 @@
/* exported WorkspaceIndicator */
const { Clutter, Gio, GObject, Meta, St } = imports.gi;
const {Clutter, Gio, GObject, Meta, St} = imports.gi;
const DND = imports.ui.dnd;
const ExtensionUtils = imports.misc.extensionUtils;
@@ -25,7 +25,7 @@ class WindowPreview extends St.Button {
});
this._delegate = this;
DND.makeDraggable(this, { restoreOnSuccess: true });
DND.makeDraggable(this, {restoreOnSuccess: true});
this._window = window;
@@ -274,7 +274,7 @@ var WorkspaceIndicator = class WorkspaceIndicator extends PanelMenu.Button {
let workspaceManager = global.workspace_manager;
this._currentWorkspace = workspaceManager.get_active_workspace_index();
this._statusLabel = new St.Label({ text: this._getStatusText() });
this._statusLabel = new St.Label({text: this._getStatusText()});
this._statusBin = new St.Bin({
style_class: 'status-label-bin',
@@ -309,7 +309,7 @@ var WorkspaceIndicator = class WorkspaceIndicator extends PanelMenu.Button {
this._updateThumbnails();
this._updateThumbnailVisibility();
this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.wm.preferences' });
this._settings = new Gio.Settings({schema_id: 'org.gnome.desktop.wm.preferences'});
this._settingsChangedId = this._settings.connect(
'changed::workspace-names', this._updateMenuLabels.bind(this));
}
@@ -327,7 +327,7 @@ var WorkspaceIndicator = class WorkspaceIndicator extends PanelMenu.Button {
}
_updateThumbnailVisibility() {
const { workspaceManager } = global;
const {workspaceManager} = global;
const vertical = workspaceManager.layout_rows === -1;
const useMenu =
vertical || workspaceManager.n_workspaces > MAX_THUMBNAILS;

View File

@@ -1,6 +1,6 @@
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
/* exported init */
const { Clutter, Graphene, GObject, St } = imports.gi;
const {Clutter, Graphene, GObject, St} = imports.gi;
const Main = imports.ui.main;
const OverviewControls = imports.ui.overviewControls;
@@ -53,13 +53,13 @@ class MyWorkspace extends Workspace.Workspace {
}
getWindowWithTooltip(id) {
const { layoutManager } = this._container;
const {layoutManager} = this._container;
const slot = layoutManager._windowSlots[id - 1];
return slot ? slot[WINDOW_SLOT].metaWindow : null;
}
showWindowsTooltips() {
const { layoutManager } = this._container;
const {layoutManager} = this._container;
for (let i = 0; i < layoutManager._windowSlots.length; i++) {
if (layoutManager._windowSlots[i])
layoutManager._windowSlots[i][WINDOW_SLOT].showTooltip(`${i + 1}`);
@@ -67,7 +67,7 @@ class MyWorkspace extends Workspace.Workspace {
}
hideWindowsTooltips() {
const { layoutManager } = this._container;
const {layoutManager} = this._container;
for (let i in layoutManager._windowSlots) {
if (layoutManager._windowSlots[i])
layoutManager._windowSlots[i][WINDOW_SLOT].hideTooltip();
@@ -93,13 +93,13 @@ class MyWorkspace extends Workspace.Workspace {
this._text.add_constraint(new Clutter.AlignConstraint({
source: this.windowContainer,
align_axis: Clutter.AlignAxis.X_AXIS,
pivot_point: new Graphene.Point({ x: 0.5, y: -1 }),
pivot_point: new Graphene.Point({x: 0.5, y: -1}),
factor: this._closeButtonSide === St.Side.LEFT ? 1 : 0,
}));
this._text.add_constraint(new Clutter.AlignConstraint({
source: this.windowContainer,
align_axis: Clutter.AlignAxis.Y_AXIS,
pivot_point: new Graphene.Point({ x: -1, y: 0.5 }),
pivot_point: new Graphene.Point({x: -1, y: 0.5}),
factor: 0,
}));
@@ -107,7 +107,7 @@ class MyWorkspace extends Workspace.Workspace {
}).call(clone);
clone.showTooltip = function (text) {
this._text.set({ text });
this._text.set({text});
this._text.show();
};
@@ -170,7 +170,7 @@ class MyWorkspacesView extends WorkspacesView.WorkspacesView {
}
_onKeyPress(s, o) {
const { ControlsState } = OverviewControls;
const {ControlsState} = OverviewControls;
if (this._overviewAdjustment.value !== ControlsState.WINDOW_PICKER)
return false;

View File

@@ -1,7 +1,7 @@
// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*-
/* exported init enable disable */
const { Clutter, Gio, GObject, Meta, St } = imports.gi;
const {Clutter, Gio, GObject, Meta, St} = imports.gi;
const DND = imports.ui.dnd;
const ExtensionUtils = imports.misc.extensionUtils;
@@ -30,7 +30,7 @@ class WindowPreview extends St.Button {
});
this._delegate = this;
DND.makeDraggable(this, { restoreOnSuccess: true });
DND.makeDraggable(this, {restoreOnSuccess: true});
this._window = window;
@@ -310,7 +310,7 @@ class WorkspaceIndicator extends PanelMenu.Button {
this._updateThumbnails();
this._updateThumbnailVisibility();
this._settings = new Gio.Settings({ schema_id: WORKSPACE_SCHEMA });
this._settings = new Gio.Settings({schema_id: WORKSPACE_SCHEMA});
this._settingsChangedId = this._settings.connect(
`changed::${WORKSPACE_KEY}`,
this._updateMenuLabels.bind(this));
@@ -331,7 +331,7 @@ class WorkspaceIndicator extends PanelMenu.Button {
}
_updateThumbnailVisibility() {
const { workspaceManager } = global;
const {workspaceManager} = global;
const vertical = workspaceManager.layout_rows === -1;
const useMenu =
vertical || workspaceManager.n_workspaces > MAX_THUMBNAILS;

View File

@@ -1,7 +1,7 @@
// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*-
/* exported init buildPrefsWidget */
const { Adw, Gio, GLib, GObject, Gtk, Pango } = imports.gi;
const {Adw, Gio, GLib, GObject, Gtk, Pango} = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
@@ -41,7 +41,7 @@ class WorkspacesList extends GObject.Object {
GObject.registerClass(this);
}
#settings = new Gio.Settings({ schema_id: WORKSPACE_SCHEMA });
#settings = new Gio.Settings({schema_id: WORKSPACE_SCHEMA});
#names = this.#settings.get_strv(WORKSPACE_KEY);
#items = Gtk.StringList.new(this.#names);
#changedId;
@@ -131,8 +131,8 @@ class WorkspaceSettingsWidget extends Adw.PreferencesGroup {
this._workspaces = new WorkspacesList();
const store = new Gio.ListStore({ item_type: Gio.ListModel });
const listModel = new Gtk.FlattenListModel({ model: store });
const store = new Gio.ListStore({item_type: Gio.ListModel});
const listModel = new Gtk.FlattenListModel({model: store});
store.append(this._workspaces);
store.append(new NewItemModel());
@@ -157,7 +157,7 @@ class WorkspaceRow extends Adw.PreferencesRow {
}
constructor(name) {
super({ name });
super({name});
const box = new Gtk.Box({
spacing: 12,

View File

@@ -3,9 +3,10 @@ rules:
- error
- properties: never
allow: [^vfunc_, ^on_]
object-curly-spacing:
consistent-return: error
eqeqeq:
- error
- always
- smart
prefer-arrow-callback: error
globals:
global: readonly

View File

@@ -1,5 +1,5 @@
project('gnome-shell-extensions',
version: '43.beta',
version: '43.rc',
meson_version: '>= 0.53.0',
license: 'GPL2+'
)