-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
29 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
const ExtensionUtils = imports.misc.extensionUtils; | ||
const Me = ExtensionUtils.getCurrentExtension(); | ||
const ShortcutMaker = Me.imports.shortcutMaker; | ||
const AppDisplay = imports.ui.appDisplay; | ||
const GObject = imports.gi.GObject; | ||
import * as ShortcutMaker from './shortcutMaker.js'; | ||
import * as AppDisplay from 'resource:///org/gnome/shell/ui/appDisplay.js'; | ||
import GObject from 'gi://GObject'; | ||
import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js'; | ||
|
||
// Saves the standard Menu globally to be able to reset it on disable | ||
var oldPopupMenu = null; | ||
|
||
function init () { | ||
|
||
} | ||
export default class AddToDesktop extends Extension { | ||
init () { | ||
} | ||
|
||
function enable () { | ||
if (GObject.type_from_name("Gjs_add-to-desktop_tommimon_github_com_shortcutMaker_CustomIcon") == null) { | ||
oldPopupMenu = AppDisplay.AppIcon.prototype.popupMenu; | ||
ShortcutMaker.editIconClass(oldPopupMenu); | ||
enable () { | ||
if (GObject.type_from_name("Gjs_add-to-desktop_tommimon_github_com_shortcutMaker_CustomIcon") == null) { | ||
oldPopupMenu = AppDisplay.AppIcon.prototype.popupMenu; | ||
ShortcutMaker.editIconClass(oldPopupMenu); | ||
} | ||
} | ||
} | ||
|
||
function disable () { | ||
// Reset the menu to the standard one (without new item) | ||
AppDisplay.AppIcon.prototype.popupMenu = oldPopupMenu; | ||
disable () { | ||
// Reset the menu to the standard one (without new item) | ||
AppDisplay.AppIcon.prototype.popupMenu = oldPopupMenu; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters