From dc08f46909e4362cce5518112ecd4877db1ec7e2 Mon Sep 17 00:00:00 2001 From: cutls Date: Fri, 18 Sep 2020 21:49:55 +0900 Subject: [PATCH] delete custom-electron-titlebar --- app/js/platform/preload.js | 16 ---------------- app/main.js | 23 ++--------------------- app/main/language.js | 7 +------ app/package.json | 5 ++--- app/yarn.lock | 5 ----- 5 files changed, 5 insertions(+), 51 deletions(-) diff --git a/app/js/platform/preload.js b/app/js/platform/preload.js index 8a999ed3..0c98e0f5 100644 --- a/app/js/platform/preload.js +++ b/app/js/platform/preload.js @@ -2,25 +2,9 @@ var electron = require('electron') const shell = electron.shell var ipc = electron.ipcRenderer //title bar -const customTitlebar = require('custom-electron-titlebar') window.addEventListener('DOMContentLoaded', () => { document.title = 'TheDesk' ipc.send('acsCheck', '') - ipc.send('frameCheck', '') - ipc.on('frame', function(event, args) { - const file = location.href.substr(-10) - if ( - file == 'index.html' || - file == '/acct.html' || - file == 'tting.html' - ) { - new customTitlebar.Titlebar({ - backgroundColor: customTitlebar.Color.fromHex('#000'), - titleHorizontalAlignment: 'right', - icon: '../../img/desk.png' - }) - } - }) }) onmessage = function(e) { diff --git a/app/main.js b/app/main.js index bcbdb81a..c4d2be52 100644 --- a/app/main.js +++ b/app/main.js @@ -124,7 +124,6 @@ function createWindow() { var max_info_path = join(app.getPath('userData'), 'max-window-size.json') var ha_path = join(app.getPath('userData'), 'hardwareAcceleration') var ua_path = join(app.getPath('userData'), 'useragent') - var frame_path = join(app.getPath('userData'), 'frame') try { fs.readFileSync(ha_path, 'utf8') app.disableHardwareAcceleration() @@ -152,19 +151,6 @@ function createWindow() { y: 'string', } // デフォルトバリュー } - - try { - var frameRaw = fs.readFileSync(frame_path, 'utf8') - if (frameRaw == 'false') { - var frame = false - var frameTitle = 'hidden' - } else { - var frame = true - var frameTitle = 'default' - } - } catch { - var frame = true - } // メイン画面の表示。ウィンドウの幅、高さを指定できる var platform = process.platform var bit = process.arch @@ -180,8 +166,7 @@ function createWindow() { height: window_size.height, x: window_size.x, y: window_size.y, - show: false, - frame: frame, + show: true, } if (platform == 'linux') { arg.resizable = true @@ -190,7 +175,6 @@ function createWindow() { arg.simpleFullscreen = true } else if (platform == 'darwin') { arg.simpleFullscreen = true - arg.titleBarStyle = frameTitle } mainWindow = new BrowserWindow(arg) mainWindow.once('page-title-updated', () => { @@ -294,10 +278,7 @@ function createWindow() { var platform = process.platform var bit = process.arch - Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, packaged, dir, dirname, frame))) - if (!frame) { - mainWindow.setMenu(null) - } + Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, packaged, dir, dirname))) //CSS css.css(mainWindow) //アップデータとダウンロード diff --git a/app/main/language.js b/app/main/language.js index 8b9beb30..ffa3c680 100644 --- a/app/main/language.js +++ b/app/main/language.js @@ -1,5 +1,5 @@ // Create the Application's main menu -function templete(lang, mainWindow, packaged, dir, dirname, frame) { +function templete(lang, mainWindow, packaged, dir, dirname) { //フレーム if(lang !="ja" && lang != "en"){ lang = "en" @@ -9,11 +9,6 @@ function templete(lang, mainWindow, packaged, dir, dirname, frame) { const app = electron.app; const BrowserWindow = electron.BrowserWindow; const join = require('path').join; - ipc.on("frameCheck", function(e, arg) { - if(!frame) { - e.sender.webContents.send("frame", ""); - } - }); const dict = { "application": { "ja": "アプリケーション", diff --git a/app/package.json b/app/package.json index 7e43315e..93a952e9 100644 --- a/app/package.json +++ b/app/package.json @@ -21,8 +21,8 @@ "build:linux:snapstore": "node view/make/make.js --automatic --store && npx electron-builder --linux", "build:mac:web": "node view/make/make.js --automatic && npx electron-builder --mac", "build:mac:homebrew": "node view/make/make.js --automatic --store && npx electron-builder --mac", - "lint:fix": "eslint js --fix" , - "lint": "eslint js" + "lint:fix": "eslint js --fix", + "lint": "eslint js" }, "keywords": [ "mastodon", @@ -60,7 +60,6 @@ "license": "GPL-3.0", "dependencies": { "@fortawesome/fontawesome-free": "^5.14.0", - "custom-electron-titlebar": "^3.2.4", "electron-dl": "^3.0.2", "jimp": "^0.16.1", "jquery": "^3.5.1", diff --git a/app/yarn.lock b/app/yarn.lock index b65ee07c..e325c96f 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -986,11 +986,6 @@ crypto-random-string@^2.0.0: resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== -custom-electron-titlebar@^3.2.4: - version "3.2.4" - resolved "https://registry.yarnpkg.com/custom-electron-titlebar/-/custom-electron-titlebar-3.2.4.tgz#671b7871f47f2da7ca9f5f659aec6ca7294aa4ed" - integrity sha512-zjjw8lcn2JwYaqLSLZtPWnP6IjPSix+nr3QNf5OPsNzdFDGORAUsIhU7A6vNg8aWpsjNc8rsvOW6MVcHwPrUDQ== - dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"