mirror of
				https://github.com/Mastermindzh/tidal-hifi.git
				synced 2025-11-04 10:49:26 +01:00 
			
		
		
		
	added temp tray and renamed mediaKeysModule
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
			
		||||
const mediaKeys = {
 | 
			
		||||
const mediaKeysModule = {
 | 
			
		||||
  play: "MediaPlayPause",
 | 
			
		||||
  next: "MediaNextTrack",
 | 
			
		||||
  previous: "MediaPreviousTrack",
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
module.exports = mediaKeys;
 | 
			
		||||
module.exports = mediaKeysModule;
 | 
			
		||||
							
								
								
									
										20
									
								
								src/scripts/tray.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								src/scripts/tray.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
const { Tray, Menu } = require("electron");
 | 
			
		||||
const trayModule = {};
 | 
			
		||||
let tray;
 | 
			
		||||
 | 
			
		||||
trayModule.addTray = function(options = { icon: "" }) {
 | 
			
		||||
  tray = new Tray(options.icon);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
trayModule.refreshTray = function() {
 | 
			
		||||
  const contextMenu = Menu.buildFromTemplate([
 | 
			
		||||
    { label: "Item1", type: "radio" },
 | 
			
		||||
    { label: "Item2", type: "radio" },
 | 
			
		||||
    { label: "Item3", type: "radio", checked: true },
 | 
			
		||||
    { label: "Item4", type: "radio" },
 | 
			
		||||
  ]);
 | 
			
		||||
  tray.setToolTip("This is my application.");
 | 
			
		||||
  tray.setContextMenu(contextMenu);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
module.exports = trayModule;
 | 
			
		||||
		Reference in New Issue
	
	Block a user