From 361fe53a7e8a48e42ac8d7f4c07f33bf4ed178e2 Mon Sep 17 00:00:00 2001 From: Starscouts Date: Sun, 14 Jul 2024 14:28:01 +0200 Subject: Fixes for Windows --- intimate/TODO.md | 0 intimate/bs5/bootstrap.bundle.min.js | 0 intimate/bs5/bootstrap.bundle.min.js.map | 0 intimate/bs5/bootstrap.min.css | 0 intimate/bs5/bootstrap.min.css.map | 0 intimate/build.sh | 3 --- intimate/default.toml | 0 intimate/fullscreen.html | 0 intimate/index.html | 1 + intimate/index.js | 14 ++++++++------ intimate/loader.svg | 0 intimate/package-lock.json | 0 intimate/package.json | 0 intimate/src/actions.js | 0 intimate/src/display.js | 0 intimate/src/fetcher.js | 1 + intimate/src/keyboard.js | 0 17 files changed, 10 insertions(+), 9 deletions(-) mode change 100755 => 100644 intimate/TODO.md mode change 100755 => 100644 intimate/bs5/bootstrap.bundle.min.js mode change 100755 => 100644 intimate/bs5/bootstrap.bundle.min.js.map mode change 100755 => 100644 intimate/bs5/bootstrap.min.css mode change 100755 => 100644 intimate/bs5/bootstrap.min.css.map mode change 100755 => 100644 intimate/build.sh mode change 100755 => 100644 intimate/default.toml mode change 100755 => 100644 intimate/fullscreen.html mode change 100755 => 100644 intimate/index.html mode change 100755 => 100644 intimate/index.js mode change 100755 => 100644 intimate/loader.svg mode change 100755 => 100644 intimate/package-lock.json mode change 100755 => 100644 intimate/package.json mode change 100755 => 100644 intimate/src/actions.js mode change 100755 => 100644 intimate/src/display.js mode change 100755 => 100644 intimate/src/fetcher.js mode change 100755 => 100644 intimate/src/keyboard.js (limited to 'intimate') diff --git a/intimate/TODO.md b/intimate/TODO.md old mode 100755 new mode 100644 diff --git a/intimate/bs5/bootstrap.bundle.min.js b/intimate/bs5/bootstrap.bundle.min.js old mode 100755 new mode 100644 diff --git a/intimate/bs5/bootstrap.bundle.min.js.map b/intimate/bs5/bootstrap.bundle.min.js.map old mode 100755 new mode 100644 diff --git a/intimate/bs5/bootstrap.min.css b/intimate/bs5/bootstrap.min.css old mode 100755 new mode 100644 diff --git a/intimate/bs5/bootstrap.min.css.map b/intimate/bs5/bootstrap.min.css.map old mode 100755 new mode 100644 diff --git a/intimate/build.sh b/intimate/build.sh old mode 100755 new mode 100644 index 3917ff6..6eaf025 --- a/intimate/build.sh +++ b/intimate/build.sh @@ -1,5 +1,2 @@ -#npx electron-packager . Intimate --overwrite --platform=darwin --arch=arm64 --icon=./logo/logo-round.ico --out=./build npx electron-packager . Intimate --overwrite --platform=darwin --arch=arm64 --out=./build npx electron-packager . Intimate --overwrite --platform=win32 --arch=x64 --out=./build -/Library/Atomic/SDK/convert_darwin_arm64.sh ./build/Intimate-darwin-arm64/Intimate.app || /Volumes/Projects/atomic/converter/convert_darwin_arm64.sh ./build/Intimate-darwin-arm64/Intimate.app -/Library/Atomic/SDK/convert_windows_x64.sh ./build/Intimate-win32-x64 || /Volumes/Projects/atomic/converter/convert_windows_x64.sh ./build/Intimate-win32-x64 diff --git a/intimate/default.toml b/intimate/default.toml old mode 100755 new mode 100644 diff --git a/intimate/fullscreen.html b/intimate/fullscreen.html old mode 100755 new mode 100644 diff --git a/intimate/index.html b/intimate/index.html old mode 100755 new mode 100644 index aa8eac0..3fc0e32 --- a/intimate/index.html +++ b/intimate/index.html @@ -126,6 +126,7 @@ if (!config.modules.derpibooru['faunerie_cache']) return i; if (!fs.existsSync(config.modules.derpibooru['faunerie_cache'] + "/images/" + i['sha512_hash'].substring(0, 1) + "/" + i['sha512_hash'].substring(0, 2) + "/" + i['sha512_hash'].substring(0, 3) + "/10" + i['id'] + ".bin")) return i; i['view_url'] = "pbip://" + config.modules.derpibooru['faunerie_cache'] + "/images/" + i['sha512_hash'].substring(0, 1) + "/" + i['sha512_hash'].substring(0, 2) + "/" + i['sha512_hash'].substring(0, 3) + "/10" + i['id'] + ".bin"; + if (process.platform === "win32") i['view_url'] = i['view_url'].replaceAll("\\", "/").replaceAll("pbip://", "pbip:///"); return i; })[0]["view_url"]; diff --git a/intimate/index.js b/intimate/index.js old mode 100755 new mode 100644 index 620398c..be295e3 --- a/intimate/index.js +++ b/intimate/index.js @@ -22,6 +22,10 @@ function createWindow () { fullscreenable: false, simpleFullscreen: true, titleBarStyle: "hidden", + titleBarOverlay: { + color: "#21252977", + symbolColor: "#ffffff" + }, backgroundColor: "#212529", autoHideMenuBar: true, webPreferences: { @@ -98,9 +102,11 @@ Menu.setApplicationMenu(menu); app.whenReady().then(() => { protocol.handle('pbip', async (req) => { - const { pathname, searchParams } = new URL(req.url); + let { pathname, searchParams } = new URL(req.url); let mime = searchParams.get("mime") ?? "application/octet-stream"; + if (process.platform === "win32") pathname = pathname.substring(1); + const inflateRawSync = util.promisify(zlib.inflateRaw); try { @@ -140,11 +146,6 @@ app.on('window-all-closed', () => { app.quit(); }); -app.on('before-quit', () => { - try { if (mainWindow) mainWindow.close(); } catch (e) { console.error(e); } - try { if (mainWindow) fullscreenWindow.close(); } catch (e) { console.error(e); } -}); - ipcMain.on('start', (_, prefs, config) => { preferences = prefs; globalConfig = config; @@ -158,6 +159,7 @@ ipcMain.on('start', (_, prefs, config) => { resizable: false, maximizable: false, minimizable: false, + autoHideMenuBar: true, webPreferences: { nodeIntegration: true, contextIsolation: false diff --git a/intimate/loader.svg b/intimate/loader.svg old mode 100755 new mode 100644 diff --git a/intimate/package-lock.json b/intimate/package-lock.json old mode 100755 new mode 100644 diff --git a/intimate/package.json b/intimate/package.json old mode 100755 new mode 100644 diff --git a/intimate/src/actions.js b/intimate/src/actions.js old mode 100755 new mode 100644 diff --git a/intimate/src/display.js b/intimate/src/display.js old mode 100755 new mode 100644 diff --git a/intimate/src/fetcher.js b/intimate/src/fetcher.js old mode 100755 new mode 100644 index 4375fe5..f5eb236 --- a/intimate/src/fetcher.js +++ b/intimate/src/fetcher.js @@ -99,6 +99,7 @@ async function slideshowMain() { if (!config.modules.derpibooru['faunerie_cache']) return i; if (!fs.existsSync(config.modules.derpibooru['faunerie_cache'] + "/images/" + i['sha512_hash'].substring(0, 1) + "/" + i['sha512_hash'].substring(0, 2) + "/" + i['sha512_hash'].substring(0, 3) + "/10" + i['id'] + ".bin")) return i; i['view_url'] = "pbip://" + config.modules.derpibooru['faunerie_cache'] + "/images/" + i['sha512_hash'].substring(0, 1) + "/" + i['sha512_hash'].substring(0, 2) + "/" + i['sha512_hash'].substring(0, 3) + "/10" + i['id'] + ".bin"; + if (process.platform === "win32") i['view_url'] = i['view_url'].replaceAll("\\", "/").replaceAll("pbip://", "pbip:///"); return i; })); window.displayQueue = window.displayQueue.sort(() => Math.random() - Math.random()); diff --git a/intimate/src/keyboard.js b/intimate/src/keyboard.js old mode 100755 new mode 100644 -- cgit