正在显示
9 个修改的文件
包含
48 行增加
和
30 行删除
此文件的差异被折叠,
点击展开。
| ... | @@ -65,7 +65,7 @@ | ... | @@ -65,7 +65,7 @@ |
| 65 | "nprogress": "^0.2.0", | 65 | "nprogress": "^0.2.0", |
| 66 | "vue": "^2.6.10", | 66 | "vue": "^2.6.10", |
| 67 | "vue-electron": "^1.0.6", | 67 | "vue-electron": "^1.0.6", |
| 68 | - "vue-router": "^3.0.7", | 68 | + "vue-router": "^3.1.3", |
| 69 | "vuex": "^3.1.1", | 69 | "vuex": "^3.1.1", |
| 70 | "vuex-electron": "^1.0.3" | 70 | "vuex-electron": "^1.0.3" |
| 71 | }, | 71 | }, |
| ... | @@ -99,13 +99,13 @@ | ... | @@ -99,13 +99,13 @@ |
| 99 | "cfonts": "^2.4.5", | 99 | "cfonts": "^2.4.5", |
| 100 | "chalk": "^2.4.2", | 100 | "chalk": "^2.4.2", |
| 101 | "copy-webpack-plugin": "^5.0.4", | 101 | "copy-webpack-plugin": "^5.0.4", |
| 102 | - "cross-env": "^5.1.6", | 102 | + "cross-env": "^5.2.1", |
| 103 | "css-loader": "^3.1.0", | 103 | "css-loader": "^3.1.0", |
| 104 | "del": "^5.0.0", | 104 | "del": "^5.0.0", |
| 105 | - "electron": "^6.0.5", | 105 | + "electron": "^6.0.7", |
| 106 | "electron-builder": "^21.2.0", | 106 | "electron-builder": "^21.2.0", |
| 107 | "electron-devtools-installer": "^2.2.4", | 107 | "electron-devtools-installer": "^2.2.4", |
| 108 | - "eslint": "^6.2.2", | 108 | + "eslint": "^6.3.0", |
| 109 | "eslint-config-standard": "^13.0.1", | 109 | "eslint-config-standard": "^13.0.1", |
| 110 | "eslint-friendly-formatter": "^4.0.1", | 110 | "eslint-friendly-formatter": "^4.0.1", |
| 111 | "eslint-loader": "^2.2.1", | 111 | "eslint-loader": "^2.2.1", | ... | ... |
| 1 | export default { | 1 | export default { |
| 2 | - Mainfunc (ipc, mainWindow) { | 2 | + Mainfunc (ipc, mainWindow, IsUseSysTitle) { |
| 3 | + ipc.on('IsUseSysTitle', (event) => { | ||
| 4 | + const data = IsUseSysTitle | ||
| 5 | + event.reply('CisUseSysTitle', data) | ||
| 6 | + }) | ||
| 3 | ipc.on('windows-mini', () => { | 7 | ipc.on('windows-mini', () => { |
| 4 | mainWindow.minimize() | 8 | mainWindow.minimize() |
| 5 | }) | 9 | }) | ... | ... |
| ... | @@ -16,7 +16,7 @@ function createMainWindow () { | ... | @@ -16,7 +16,7 @@ function createMainWindow () { |
| 16 | useContentSize: true, | 16 | useContentSize: true, |
| 17 | width: 1000, | 17 | width: 1000, |
| 18 | show: false, | 18 | show: false, |
| 19 | - frame: false, | 19 | + frame: config.IsUseSysTitle, |
| 20 | titleBarStyle: 'hidden', | 20 | titleBarStyle: 'hidden', |
| 21 | webPreferences: { | 21 | webPreferences: { |
| 22 | nodeIntegration: true | 22 | nodeIntegration: true |
| ... | @@ -27,7 +27,7 @@ function createMainWindow () { | ... | @@ -27,7 +27,7 @@ function createMainWindow () { |
| 27 | Menu.setApplicationMenu(menu) | 27 | Menu.setApplicationMenu(menu) |
| 28 | mainWindow.loadURL(winURL) | 28 | mainWindow.loadURL(winURL) |
| 29 | 29 | ||
| 30 | - setIpc.Mainfunc(ipcMain, mainWindow) | 30 | + setIpc.Mainfunc(ipcMain, mainWindow, config.IsUseSysTitle) |
| 31 | 31 | ||
| 32 | if (process.env.NODE_ENV === 'development') { | 32 | if (process.env.NODE_ENV === 'development') { |
| 33 | mainWindow.webContents.once('dom-ready', () => { | 33 | mainWindow.webContents.once('dom-ready', () => { | ... | ... |
| 1 | <!-- --> | 1 | <!-- --> |
| 2 | <template> | 2 | <template> |
| 3 | - <div class="window-title"> | 3 | + <div class="window-title" v-if="!IsUseSysTitle"> |
| 4 | <!-- 软件logo预留位置 --> | 4 | <!-- 软件logo预留位置 --> |
| 5 | - <div style="-webkit-app-region: drag;" class="logo"></div> | 5 | + <div style="-webkit-app-region: drag;" class="logo"> |
| 6 | + <svg-icon icon-class="electron-logo"></svg-icon> | ||
| 7 | + </div> | ||
| 6 | <!-- 菜单栏位置 --> | 8 | <!-- 菜单栏位置 --> |
| 7 | <div></div> | 9 | <div></div> |
| 8 | <!-- 中间标题位置 --> | 10 | <!-- 中间标题位置 --> |
| 9 | - <div style="-webkit-app-region: drag;">标题文字</div> | 11 | + <div style="-webkit-app-region: drag;" class="title">标题文字</div> |
| 10 | <div class="controls-container"> | 12 | <div class="controls-container"> |
| 11 | <div class="windows-icon-bg" @click="Mini"> | 13 | <div class="windows-icon-bg" @click="Mini"> |
| 12 | <svg-icon icon-class="mini" class-name="icon-size"></svg-icon> | 14 | <svg-icon icon-class="mini" class-name="icon-size"></svg-icon> |
| ... | @@ -23,28 +25,31 @@ | ... | @@ -23,28 +25,31 @@ |
| 23 | </template> | 25 | </template> |
| 24 | 26 | ||
| 25 | <script> | 27 | <script> |
| 28 | +import ipcApi from "@/utils/ipcRenderer"; | ||
| 26 | export default { | 29 | export default { |
| 27 | data: () => ({ | 30 | data: () => ({ |
| 28 | - mix: false | 31 | + mix: false, |
| 32 | + IsUseSysTitle: false | ||
| 29 | }), | 33 | }), |
| 30 | 34 | ||
| 31 | components: {}, | 35 | components: {}, |
| 36 | + created() { | ||
| 37 | + ipcApi.send("IsUseSysTitle"); | ||
| 38 | + ipcApi.on("CisUseSysTitle", (event, arg) => (this.IsUseSysTitle = arg)); | ||
| 39 | + }, | ||
| 32 | 40 | ||
| 33 | mounted() {}, | 41 | mounted() {}, |
| 34 | 42 | ||
| 35 | methods: { | 43 | methods: { |
| 36 | Mini() { | 44 | Mini() { |
| 37 | - this.$electron.ipcRenderer.send("windows-mini"); | 45 | + ipcApi.send("windows-mini"); |
| 38 | }, | 46 | }, |
| 39 | MixOrReduction() { | 47 | MixOrReduction() { |
| 40 | - this.$electron.ipcRenderer.send("window-max"); | 48 | + ipcApi.send("window-max"); |
| 41 | - this.$electron.ipcRenderer.on( | 49 | + ipcApi.on("window-confirm", (event, arg) => (this.mix = arg)); |
| 42 | - "window-confirm", | ||
| 43 | - (event, arg) => (this.mix = arg) | ||
| 44 | - ); | ||
| 45 | }, | 50 | }, |
| 46 | Close() { | 51 | Close() { |
| 47 | - this.$electron.ipcRenderer.send("window-close"); | 52 | + ipcApi.send("window-close"); |
| 48 | } | 53 | } |
| 49 | } | 54 | } |
| 50 | }; | 55 | }; |
| ... | @@ -54,13 +59,15 @@ export default { | ... | @@ -54,13 +59,15 @@ export default { |
| 54 | width: 100%; | 59 | width: 100%; |
| 55 | height: 30px; | 60 | height: 30px; |
| 56 | line-height: 30px; | 61 | line-height: 30px; |
| 57 | - background-color: #ffffff; | 62 | + background-color: rgba(60, 60, 60, 0.6); |
| 58 | - color: rgba(60, 60, 60, 0.6); | ||
| 59 | display: flex; | 63 | display: flex; |
| 60 | -webkit-app-region: drag; | 64 | -webkit-app-region: drag; |
| 61 | position: fixed; | 65 | position: fixed; |
| 62 | top: 0; | 66 | top: 0; |
| 63 | z-index: 99999; | 67 | z-index: 99999; |
| 68 | + .title { | ||
| 69 | + text-align: center; | ||
| 70 | + } | ||
| 64 | .controls-container { | 71 | .controls-container { |
| 65 | display: flex; | 72 | display: flex; |
| 66 | flex-grow: 0; | 73 | flex-grow: 0; |
| ... | @@ -77,13 +84,14 @@ export default { | ... | @@ -77,13 +84,14 @@ export default { |
| 77 | -webkit-app-region: no-drag; | 84 | -webkit-app-region: no-drag; |
| 78 | height: 100%; | 85 | height: 100%; |
| 79 | width: 33.34%; | 86 | width: 33.34%; |
| 87 | + color: rgba(129, 129, 129, 0.6); | ||
| 80 | .icon-size { | 88 | .icon-size { |
| 81 | width: 12px; | 89 | width: 12px; |
| 82 | height: 12px; | 90 | height: 12px; |
| 83 | } | 91 | } |
| 84 | } | 92 | } |
| 85 | .windows-icon-bg:hover { | 93 | .windows-icon-bg:hover { |
| 86 | - background-color: rgba(85, 85, 85, 0.2); | 94 | + background-color: rgba(182, 182, 182, 0.2); |
| 87 | color: #333; | 95 | color: #333; |
| 88 | } | 96 | } |
| 89 | .close-icon:hover { | 97 | .close-icon:hover { | ... | ... |
src/renderer/icons/svg/electron-logo.svg
0 → 100644
此文件的差异被折叠,
点击展开。
| ... | @@ -15,6 +15,10 @@ body { | ... | @@ -15,6 +15,10 @@ body { |
| 15 | 15 | ||
| 16 | html { | 16 | html { |
| 17 | box-sizing: border-box; | 17 | box-sizing: border-box; |
| 18 | + | ||
| 19 | + ::-webkit-scrollbar { | ||
| 20 | + display: none; | ||
| 21 | + } | ||
| 18 | } | 22 | } |
| 19 | 23 | ||
| 20 | *, | 24 | *, |
| ... | @@ -23,7 +27,7 @@ html { | ... | @@ -23,7 +27,7 @@ html { |
| 23 | box-sizing: inherit; | 27 | box-sizing: inherit; |
| 24 | } | 28 | } |
| 25 | 29 | ||
| 26 | -div:focus{ | 30 | +div:focus { |
| 27 | outline: none; | 31 | outline: none; |
| 28 | } | 32 | } |
| 29 | 33 | ||
| ... | @@ -52,10 +56,10 @@ a:hover { | ... | @@ -52,10 +56,10 @@ a:hover { |
| 52 | } | 56 | } |
| 53 | 57 | ||
| 54 | //main-container全局样式 | 58 | //main-container全局样式 |
| 55 | -.app-main{ | 59 | +.app-main { |
| 56 | min-height: 100% | 60 | min-height: 100% |
| 57 | } | 61 | } |
| 58 | 62 | ||
| 59 | .app-container { | 63 | .app-container { |
| 60 | padding: 20px; | 64 | padding: 20px; |
| 61 | -} | 65 | +} |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | -import $Vm from '../main' | 1 | +import $electron from 'electron' |
| 2 | 2 | ||
| 3 | export default { | 3 | export default { |
| 4 | - send (data) { | 4 | + send (data, cb) { |
| 5 | - $Vm.$electron.ipcRenderer.send(data, (event, arg) => { | 5 | + $electron.ipcRenderer.send(data, (event, arg) => cb(event, arg)) |
| 6 | - | 6 | + }, |
| 7 | - }) | 7 | + on (data, cb) { |
| 8 | + $electron.ipcRenderer.on(data, (event, arg) => cb(event, arg)) | ||
| 8 | } | 9 | } |
| 9 | } | 10 | } | ... | ... |
-
请 注册 或 登录 后发表评论