From bcdd786134a6e118f62141da5c941d1c28c5d73f Mon Sep 17 00:00:00 2001 From: iceyrazor Date: Sun, 25 Aug 2024 04:23:04 -0500 Subject: init --- src/imgassets/foldericon.ico | Bin 0 -> 67646 bytes src/imgassets/icon.ico | Bin 0 -> 76702 bytes src/imgassets/icon.pdn | Bin 0 -> 4662 bytes src/index.html | 347 +++++++++++++++++++++++++++++++++++++++++++ src/main.js | 61 ++++++++ 5 files changed, 408 insertions(+) create mode 100644 src/imgassets/foldericon.ico create mode 100644 src/imgassets/icon.ico create mode 100644 src/imgassets/icon.pdn create mode 100644 src/index.html create mode 100644 src/main.js (limited to 'src') diff --git a/src/imgassets/foldericon.ico b/src/imgassets/foldericon.ico new file mode 100644 index 0000000..e246128 Binary files /dev/null and b/src/imgassets/foldericon.ico differ diff --git a/src/imgassets/icon.ico b/src/imgassets/icon.ico new file mode 100644 index 0000000..10e2bbd Binary files /dev/null and b/src/imgassets/icon.ico differ diff --git a/src/imgassets/icon.pdn b/src/imgassets/icon.pdn new file mode 100644 index 0000000..bccfc44 Binary files /dev/null and b/src/imgassets/icon.pdn differ diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..ea6fa23 --- /dev/null +++ b/src/index.html @@ -0,0 +1,347 @@ + + + + + + + + + + +
+ +
+
reload everything
+
add folder to list
+
+ + + + + + \ No newline at end of file diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..95328f2 --- /dev/null +++ b/src/main.js @@ -0,0 +1,61 @@ +const electron = require('electron'), + {app,BrowserWindow,Menu,Tray,ipcMain} = require('electron'), + path = require('path'); + +myWindow=null; +global.tray=null; +app.whenReady().then(()=>{ + //set tray icon + tray = new Tray(path.join(__dirname+'/imgassets/icon.ico')) + const contextMenu = Menu.buildFromTemplate([ + {label:"on top",click(){ + switch(myWindow.isAlwaysOnTop()){ + case true: + myWindow.setAlwaysOnTop(false); + break; + case false: + myWindow.setAlwaysOnTop(true) + break; + } + }}, + {label:"exit",click(){ app.quit(); }}, + ]) + tray.setToolTip('better file browser') + tray.setContextMenu(contextMenu) + + //figure out screens + primaryscreen=electron.screen.getPrimaryDisplay() + + //create window + myWindow=new BrowserWindow({ + width: Math.floor(primaryscreen.bounds.width/5), + //width: 800, + height: primaryscreen.bounds.height, + frame: false, + transparent:true, + webPreferences:{ + nodeIntegration: true, + contextIsolation: false, + enableRemoteModule: false, + } + }); + //set intial position + myWindow.setPosition(primaryscreen.bounds.width-myWindow.getBounds().width,0) + + myWindow.setAlwaysOnTop(true); + + myWindow.loadFile('src/index.html'); + myWindow.once('ready-to-show', () => { + //myWindow.webContents.openDevTools() + myWindow.setIgnoreMouseEvents(true, { forward: true }); + }); + +}); + +ipcMain.on('set-click',(event,arg)=>{ + if(arg=='false'){ + myWindow.setIgnoreMouseEvents(false) + } else { + myWindow.setIgnoreMouseEvents(true, { forward: true }); + } +}) \ No newline at end of file -- cgit v1.3