Skip to content

Commit

Permalink
feat(main): add application icon
Browse files Browse the repository at this point in the history
  • Loading branch information
ysfscream authored and CrazyWisdom committed Nov 11, 2019
1 parent ea64199 commit b06bf96
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 26 deletions.
25 changes: 3 additions & 22 deletions README.md
@@ -1,4 +1,5 @@
# MQTTX

Cross-platform MQTT desktop client

## Project setup
Expand All @@ -8,32 +9,12 @@ yarn install

### Compiles and hot-reloads for development
```
yarn run serve
yarn run electron:serve
```

### Compiles and minifies for production
```
yarn run build
```

### Run your tests
```
yarn run test
```

### Lints and fixes files
```
yarn run lint
```

### Run your end-to-end tests
```
yarn run test:e2e
```

### Run your unit tests
```
yarn run test:unit
yarn run electron:build
```

### Customize configuration
Expand Down
4 changes: 3 additions & 1 deletion package.json
@@ -1,12 +1,14 @@
{
"name": "MQTTX",
"author": "emqx",
"version": "1.0.0",
"license": "Apache",
"description": "MQTT desktop client",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"electron:build": "vue-cli-service electron:build",
"electron:build": "vue-cli-service electron:build --platform=all",
"electron:serve": "vue-cli-service electron:serve",
"postinstall": "electron-builder install-app-deps",
"postuninstall": "electron-builder install-app-deps",
Expand Down
Binary file added public/app.ico
Binary file not shown.
Binary file added public/app.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.ico
Binary file not shown.
13 changes: 10 additions & 3 deletions src/background.ts
Expand Up @@ -27,12 +27,19 @@ interface WindowSizeModel {
height: number,
}

declare const __static: string

function createWindow() {
const windowSize = db.get<WindowSizeModel>('windowSize')
// Create the browser window.
win = new BrowserWindow({ ...windowSize, webPreferences: {
nodeIntegration: true,
} })
win = new BrowserWindow({
...windowSize,
webPreferences: {
webSecurity: false,
nodeIntegration: true,
},
icon: `${__static}/app.ico`,
})

if (process.env.WEBPACK_DEV_SERVER_URL) {
// Load the url of the dev server if in development mode
Expand Down
17 changes: 17 additions & 0 deletions vue.config.js
@@ -0,0 +1,17 @@
module.exports = {
pluginOptions: {
electronBuilder: {
builderOptions: {
win: {
icon: './public/app.ico'
},
mac: {
icon: './public/app.png'
},
linux: {
icon: './public/app.png'
}
}
}
}
}

0 comments on commit b06bf96

Please sign in to comment.