Skip to content

Commit a519ce2

Browse files
hasOwnProperty changed to prototype.hasOwnProperty
New screenshot / updated readme.md Icon updates New QuickToggleIcon
1 parent dbfe8b2 commit a519ce2

File tree

6 files changed

+355
-10
lines changed

6 files changed

+355
-10
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@ is a Gnome Shell extension which keeps track of all application windows and rest
1313

1414
## screenshots
1515

16+
#### QuickSettings
17+
18+
![screenshot: quick settings](docs/screenshot-quicksettings.png)
19+
20+
The toggle in quicksettings is connected to the "Freeze saves" switch of settings.
21+
1622
#### General
1723

18-
![screenshot: saved windows preferences](docs/screenshot-general.png)
24+
![screenshot: general preferences](docs/screenshot-general.png)
1925

2026
#### Saved Windows
2127

[email protected]/extension.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Meta from "gi://Meta";
55
import GLib from "gi://GLib";
66
import Gio from "gi://Gio";
77
import GObject from "gi://GObject";
8+
import St from "gi://St";
89

910
import { Extension } from "resource:///org/gnome/shell/extensions/extension.js";
1011
import * as QuickSettings from "resource:///org/gnome/shell/ui/quickSettings.js";
@@ -22,15 +23,21 @@ const SmartAutoMoveNGMenuToggle = GObject.registerClass(
2223
const { _settings } = Me;
2324
super({
2425
title: "Smart Auto Move NG",
25-
iconName: "preferences-other-symbolic",
2626
toggleMode: true,
2727
});
28-
29-
this.menu.setHeader(
30-
"preferences-other-symbolic",
31-
"Smart Auto Move NG",
32-
""
33-
);
28+
this._path = Me.path;
29+
// Icon
30+
const SmartAutoMoveNGIcon = "smartautomoveng-symbolic";
31+
this._finalMenuIcon = SmartAutoMoveNGIcon;
32+
this._iconTheme = new St.IconTheme();
33+
if (!this._iconTheme.has_icon(SmartAutoMoveNGIcon)) {
34+
const IconPath = "/icons/";
35+
this._finalMenuIcon = Gio.icon_new_for_string(
36+
`${this._path}${IconPath}${SmartAutoMoveNGIcon}.svg`
37+
);
38+
}
39+
this.gicon = this._finalMenuIcon;
40+
this.menu.setHeader(this._finalMenuIcon, "Smart Auto Move NG", "");
3441

3542
_settings.bind(
3643
"freeze-saves",
@@ -386,7 +393,7 @@ export default class SmartAutoMoveNG extends Extension {
386393
_pushSavedWindow(win) {
387394
let wsh = this._windowSectionHash(win);
388395
if (wsh === null) return false;
389-
if (!this._savedWindows.hasOwnProperty(wsh))
396+
if (!Object.prototype.hasOwnProperty.call(this._savedWindows, wsh))
390397
this._savedWindows[wsh] = [];
391398
let sw = this._windowData(win);
392399
this._savedWindows[wsh].push(sw);

0 commit comments

Comments
 (0)