@@ -119,18 +119,12 @@ class ReloadAllMenuItem extends PopupMenu.PopupBaseMenuItem {
119119 let icon_file = Gio . file_new_for_path ( icon_path ) ;
120120 let icon , gicon ;
121121
122- //~ let icon = new St.Icon({ icon_name: type+"-symbolic", icon_type: St.IconType.SYMBOLIC, icon_size: this.parent.icon_size });
123-
124122 gicon = Gio . icon_new_for_string ( icon_path ) ;
125- //~ icon = new St.Icon({ gicon: gicon, icon_type: St.IconType.FULLCOLOR, icon_size: this.parent.icon_size });
126- //~ icon = new St.Icon({ gicon: gicon, icon_type: St.IconType.SYMBOLIC, icon_size: this.parent.icon_size, });
127- //~ icon = new St.Icon({ gicon: gicon, icon_type: St.IconType.SYMBOLIC, });
128123 icon = new St . Icon ( ) ;
129124 icon . set_icon_size ( this . parent . icon_size ) ;
130125 icon . set_icon_type ( St . IconType . SYMBOLIC ) ;
131126 icon . set_gicon ( gicon ) ;
132127
133- //~ let icon = new St.Icon({ icon_name: ICONS_DIR + "/" + type+"-symbolic", icon_type: St.IconType.SYMBOLIC, icon_size: this.parent.icon_size });
134128 try {
135129 icon_box . add_actor ( icon ) ;
136130 } catch ( e ) {
@@ -157,40 +151,29 @@ class LGSMenuItem extends PopupMenu.PopupBaseMenuItem {
157151 let label = new St . Label ( { style : "spacing: .25em;" , x_align : St . Align . START , x_expand : true , text : uuid , reactive : true , track_hover : true } ) ;
158152
159153 let icon_box = new St . BoxLayout ( { style : "spacing: .25em;" , x_align : St . Align . START , x_expand : false , reactive : true , track_hover : true } ) ;
160- let icon_path = HOME_DIR + "/.cache/cinnamon/spices/" + type . slice ( 0 , - 1 ) + "/" + uuid + ".png" ;
161- let icon_file = Gio . file_new_for_path ( icon_path ) ;
154+ let icon_path , icon_file ;
162155 let icon , gicon ;
163156
157+ icon_path = SPICES_DIR + "/" + type + "/" + uuid + "/icon.png" ;
158+ icon_file = Gio . file_new_for_path ( icon_path ) ;
164159 if ( icon_file . query_exists ( null ) ) {
165160 gicon = Gio . icon_new_for_string ( icon_path ) ;
166161 icon = new St . Icon ( { gicon : gicon , icon_type : St . IconType . FULLCOLOR , icon_size : this . parent . icon_size } ) ;
167- //~ icon = new St.Icon({ gicon: gicon, icon_type: St.IconType.FULLCOLOR, });
168162 } else {
169- icon_path = SPICES_DIR + "/" + type + "/" + uuid + "/icon.png" ;
170- icon_file = Gio . file_new_for_path ( icon_path ) ;
171- if ( icon_file . query_exists ( null ) ) {
172- gicon = Gio . icon_new_for_string ( icon_path ) ;
173- icon = new St . Icon ( { gicon : gicon , icon_type : St . IconType . FULLCOLOR , icon_size : this . parent . icon_size } ) ;
174- //~ icon = new St.Icon({ gicon: gicon, icon_type: St.IconType.FULLCOLOR, });
175- } else {
176- let metadataJson_path = SPICES_DIR + "/" + type + "/" + uuid + "/metadata.json" ;
177- let metadataJson_file = Gio . file_new_for_path ( metadataJson_path ) ;
178- if ( metadataJson_file . query_exists ( null ) ) {
179- let [ success , array_chars ] = GLib . file_get_contents ( metadataJson_path ) ;
180- let contents = to_string ( array_chars ) ;
181- let metadata = JSON . parse ( contents ) ;
182- if ( metadata [ "icon" ] ) {
183- icon = new St . Icon ( { icon_name : metadata [ "icon" ] , icon_type : St . IconType . SYMBOLIC , icon_size : this . parent . icon_size } ) ;
184- //~ icon = new St.Icon({ icon_name: metadata["icon"], icon_type: St.IconType.SYMBOLIC, });
185- } else {
186- icon = new St . Icon ( { icon_name : type + "-symbolic" , icon_type : St . IconType . SYMBOLIC , icon_size : this . parent . icon_size } ) ;
187- //~ icon = new St.Icon({ icon_name: type+"-symbolic", icon_type: St.IconType.SYMBOLIC, });
188- }
189- GLib . free ( array_chars ) ;
163+ let metadataJson_path = SPICES_DIR + "/" + type + "/" + uuid + "/metadata.json" ;
164+ let metadataJson_file = Gio . file_new_for_path ( metadataJson_path ) ;
165+ if ( metadataJson_file . query_exists ( null ) ) {
166+ let [ success , array_chars ] = GLib . file_get_contents ( metadataJson_path ) ;
167+ let contents = to_string ( array_chars ) ;
168+ let metadata = JSON . parse ( contents ) ;
169+ if ( metadata [ "icon" ] ) {
170+ icon = new St . Icon ( { icon_name : metadata [ "icon" ] , icon_type : St . IconType . SYMBOLIC , icon_size : this . parent . icon_size } ) ;
190171 } else {
191172 icon = new St . Icon ( { icon_name : type + "-symbolic" , icon_type : St . IconType . SYMBOLIC , icon_size : this . parent . icon_size } ) ;
192- //~ icon = new St.Icon({ icon_name: type+"-symbolic", icon_type: St.IconType.SYMBOLIC, });
193173 }
174+ GLib . free ( array_chars ) ;
175+ } else {
176+ icon = new St . Icon ( { icon_name : type + "-symbolic" , icon_type : St . IconType . SYMBOLIC , icon_size : this . parent . icon_size } ) ;
194177 }
195178 }
196179
@@ -387,7 +370,6 @@ class LGS extends Applet.IconApplet {
387370 sectionReload . addMenuItem ( subMenuReloadApplets ) ;
388371
389372 if ( this . show_reload_all ) {
390- //~ let itemReloadAllApplets = new PopupMenu.PopupMenuItem(_("RELOAD ALL"), {style_class: "menu-selected-app-title"}); // make it bold.
391373 let itemReloadAllApplets = new ReloadAllMenuItem ( this , "applets" , { } ) ;
392374 itemReloadAllApplets . connect (
393375 "activate" ,
@@ -414,7 +396,6 @@ class LGS extends Applet.IconApplet {
414396 sectionReload . addMenuItem ( subMenuReloadDesklets ) ;
415397
416398 if ( this . show_reload_all ) {
417- //~ let itemReloadAllDesklets = new PopupMenu.PopupMenuItem(_("RELOAD ALL"), {style_class: "menu-selected-app-title"}); // make it bold.
418399 let itemReloadAllDesklets = new ReloadAllMenuItem ( this , "desklets" , { } ) ;
419400 itemReloadAllDesklets . connect (
420401 "activate" ,
0 commit comments