mirror of
https://github.com/cupcakearmy/unpixel.git
synced 2024-12-22 08:06:33 +00:00
linux support
This commit is contained in:
parent
eeae431e79
commit
f5741e381d
@ -11,7 +11,7 @@
|
||||
"repository": {
|
||||
"url": "https://github.com/cupcakearmy/unpixel"
|
||||
},
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"main": "./dist/back/index.js",
|
||||
"scripts": {
|
||||
"start": "electron .",
|
||||
@ -53,6 +53,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.0.0-0",
|
||||
"@types/auto-launch": "^5.0.1",
|
||||
"@types/react": "^17.0.3",
|
||||
"@types/react-dom": "^17.0.3",
|
||||
"electron": "^12.0.0",
|
||||
|
@ -1,6 +1,7 @@
|
||||
import dayjs from 'dayjs'
|
||||
import { BrowserWindow, BrowserWindowConstructorOptions, ipcMain } from 'electron'
|
||||
import { join } from 'path'
|
||||
import os from 'os'
|
||||
import { BrowserWindow, BrowserWindowConstructorOptions, ipcMain } from 'electron'
|
||||
import dayjs from 'dayjs'
|
||||
import logger from 'electron-log'
|
||||
|
||||
import { DEV } from '.'
|
||||
@ -48,30 +49,33 @@ export default class Banner {
|
||||
},
|
||||
width: 1200,
|
||||
height: 600,
|
||||
}
|
||||
if (!DEV) {
|
||||
Object.assign(options, {
|
||||
resizable: false,
|
||||
movable: false,
|
||||
simpleFullscreen: true,
|
||||
fullscreen: true,
|
||||
transparent: true,
|
||||
})
|
||||
fullscreen: !DEV,
|
||||
}
|
||||
this.window = new BrowserWindow(options)
|
||||
|
||||
const entry = join(__dirname, '../front/banner/index.html')
|
||||
this.window.loadFile(entry)
|
||||
|
||||
if (!DEV) {
|
||||
this.window.maximize()
|
||||
if (DEV) {
|
||||
this.window.webContents.toggleDevTools()
|
||||
} else {
|
||||
switch (os.platform()) {
|
||||
case 'win32':
|
||||
break
|
||||
case 'linux':
|
||||
break
|
||||
case 'darwin':
|
||||
this.window.setSimpleFullScreen(true)
|
||||
this.window.setFullScreenable(false)
|
||||
break
|
||||
}
|
||||
// this.window.maximize()
|
||||
this.window.setAlwaysOnTop(true, 'floating', 99)
|
||||
this.window.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true })
|
||||
this.window.setFullScreenable(false)
|
||||
} else {
|
||||
this.window.webContents.toggleDevTools()
|
||||
this.window.setMovable(false)
|
||||
this.window.setResizable(false)
|
||||
this.window.focus()
|
||||
}
|
||||
this.window.focus()
|
||||
}
|
||||
|
||||
static close() {
|
||||
|
@ -6,13 +6,11 @@ import Settings from './settings'
|
||||
import Banner from './banner'
|
||||
import Updater from './updater'
|
||||
|
||||
export const DEV = !app.isPackaged
|
||||
export const DEV = !app.isPackaged && false
|
||||
|
||||
// Enforce single instance
|
||||
const isMain = app.requestSingleInstanceLock()
|
||||
if (!isMain) {
|
||||
app.quit()
|
||||
}
|
||||
if (!isMain) app.quit()
|
||||
|
||||
// Disable gpu
|
||||
app.disableHardwareAcceleration()
|
||||
|
@ -61,7 +61,7 @@ export default class Settings {
|
||||
|
||||
static open() {
|
||||
if (this.win) return
|
||||
this.win = new BrowserWindow({
|
||||
Settings.win = new BrowserWindow({
|
||||
width: 400,
|
||||
height: 575,
|
||||
center: true,
|
||||
@ -74,6 +74,7 @@ export default class Settings {
|
||||
|
||||
const entry = join(__dirname, '../front/settings/index.html')
|
||||
Settings.win.loadFile(entry)
|
||||
Settings.win.setMenu(null)
|
||||
|
||||
if (DEV) {
|
||||
Settings.win.setSize(800, 485)
|
||||
|
@ -53,6 +53,7 @@
|
||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||
"resolveJsonModule": true,
|
||||
|
||||
/* Source Map Options */
|
||||
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||
|
@ -1584,6 +1584,11 @@
|
||||
dependencies:
|
||||
defer-to-connect "^1.0.1"
|
||||
|
||||
"@types/auto-launch@^5.0.1":
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/auto-launch/-/auto-launch-5.0.1.tgz#388a047edc0e754d8e8978cbd9ed4672b36be2c4"
|
||||
integrity sha512-+KQ+/koZ7sJXnf5cnCANofY6yXAdYJNEoVZEuWcwJfuWbUp9u6l09I7KhwD+ivU+cdz7JId4V5ukxscWtHdSuw==
|
||||
|
||||
"@types/debug@^4.1.5":
|
||||
version "4.1.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd"
|
||||
|
Loading…
Reference in New Issue
Block a user