From dbe72c3a27bedc2899a3891dab8bbc12473db5af Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Fri, 14 Sep 2018 09:38:14 +1200 Subject: [PATCH] Colorized placeholder --- desktop/main.js | 91 +++++++++++++++++------------- desktop/package.json | 4 +- desktop/sources/links/theme.css | 1 + desktop/sources/scripts/dotgrid.js | 4 +- 4 files changed, 57 insertions(+), 43 deletions(-) diff --git a/desktop/main.js b/desktop/main.js index 3084a7d..fcdf50a 100644 --- a/desktop/main.js +++ b/desktop/main.js @@ -5,6 +5,55 @@ const shell = require('electron').shell let is_shown = true; +app.win = null; + +app.on('ready', () => +{ + app.win = new BrowserWindow({ + width: 405, + height: 420, + minWidth: 405, + minHeight: 420, + webPreferences: {zoomFactor: 1.0}, + backgroundColor:"#000", + frame:false, + autoHideMenuBar: true, + icon: __dirname + '/icon.ico' + }) + + app.win.loadURL(`file://${__dirname}/sources/index.html`); + // app.win.toggleDevTools(); + + app.win.on('closed', () => { + win = null + app.quit() + }) + + app.win.on('hide',function() { + is_shown = false; + }) + + app.win.on('show',function() { + is_shown = true; + }) + + app.on('window-all-closed', () => + { + app.quit() + }) + + app.on('activate', () => { + if (app.win === null) { + createWindow() + } + else{ + app.win.show(); + } + }) +}) + + + app.inspect = function() { app.win.toggleDevTools(); @@ -22,43 +71,7 @@ app.toggle_visible = function() app.inject_menu = function(m) { + if(process.platform == "win32"){ return; } + Menu.setApplicationMenu(Menu.buildFromTemplate(m)); -} - -app.win = null; - -app.on('ready', () => -{ - app.win = new BrowserWindow({width: 405, height: 420, minWidth: 405, minHeight: 420,webPreferences: {zoomFactor: 1.0}, backgroundColor:"#000", frame:false, autoHideMenuBar: true, icon: __dirname + '/icon.ico'}) - - app.win.loadURL(`file://${__dirname}/sources/index.html`); - app.win.scaleFactor = require('electron').screen.getPrimaryDisplay().scaleFactor; - // app.win.toggleDevTools(); - - app.win.on('closed', () => { - win = null - app.quit() - }) - - app.win.on('hide',function() { - is_shown = false; - }) - - app.win.on('show',function() { - is_shown = true; - }) -}) - -app.on('window-all-closed', () => -{ - app.quit() -}) - -app.on('activate', () => { - if (app.win === null) { - createWindow() - } - else{ - app.win.show(); - } -}) \ No newline at end of file +} \ No newline at end of file diff --git a/desktop/package.json b/desktop/package.json index 04af948..b5bd721 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -17,9 +17,9 @@ "push": "npm run build ; npm run push_theme ; npm run push_osx ; npm run push_linux ; npm run push_win ; npm run clean ; npm run push_status" }, "devDependencies": { - "electron": "^1.8.7" + "electron": "^1.8.8" }, "dependencies": { - "electron-packager": "^12.1.0" + "electron-packager": "^12.1.1" } } diff --git a/desktop/sources/links/theme.css b/desktop/sources/links/theme.css index f8c1fbe..205a7f5 100644 --- a/desktop/sources/links/theme.css +++ b/desktop/sources/links/theme.css @@ -1,6 +1,7 @@ body { background:var(--background) !important; } #picker { background-color:var(--b_inv) !important; color:var(--f_inv) !important; } #picker:before { color:var(--f_med) !important; } +#picker input::placeholder { color:var(--f_med) !important; } .fh { color:var(--f_high) !important; stroke:var(--f_high) !important; } .fm { color:var(--f_med) !important ; stroke:var(--f_med) !important; } .fl { color:var(--f_low) !important ; stroke:var(--f_low) !important; } diff --git a/desktop/sources/scripts/dotgrid.js b/desktop/sources/scripts/dotgrid.js index 285e6bc..249bfe6 100644 --- a/desktop/sources/scripts/dotgrid.js +++ b/desktop/sources/scripts/dotgrid.js @@ -23,8 +23,8 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y) { host.appendChild(this.guide.el); - this.interface.install(document.body); - this.theme.install(document.body,this.update); + this.interface.install(host); + this.theme.install(host,this.update); } this.start = function()