@@ -5,6 +5,7 @@ import Meta from "gi://Meta";
5
5
import GLib from "gi://GLib" ;
6
6
import Gio from "gi://Gio" ;
7
7
import GObject from "gi://GObject" ;
8
+ import St from "gi://St" ;
8
9
9
10
import { Extension } from "resource:///org/gnome/shell/extensions/extension.js" ;
10
11
import * as QuickSettings from "resource:///org/gnome/shell/ui/quickSettings.js" ;
@@ -22,15 +23,21 @@ const SmartAutoMoveNGMenuToggle = GObject.registerClass(
22
23
const { _settings } = Me ;
23
24
super ( {
24
25
title : "Smart Auto Move NG" ,
25
- iconName : "preferences-other-symbolic" ,
26
26
toggleMode : true ,
27
27
} ) ;
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" , "" ) ;
34
41
35
42
_settings . bind (
36
43
"freeze-saves" ,
@@ -386,7 +393,7 @@ export default class SmartAutoMoveNG extends Extension {
386
393
_pushSavedWindow ( win ) {
387
394
let wsh = this . _windowSectionHash ( win ) ;
388
395
if ( wsh === null ) return false ;
389
- if ( ! this . _savedWindows . hasOwnProperty ( wsh ) )
396
+ if ( ! Object . prototype . hasOwnProperty . call ( this . _savedWindows , wsh ) )
390
397
this . _savedWindows [ wsh ] = [ ] ;
391
398
let sw = this . _windowData ( win ) ;
392
399
this . _savedWindows [ wsh ] . push ( sw ) ;
0 commit comments