Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add vibrancy sidebar for macos #953

Merged
merged 1 commit into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
"css-loader": "^5.2.4",
"css-minimizer-webpack-plugin": "^3.0.0",
"del": "^6.0.0",
"electron": "^11.4.5",
"electron": "^11.4.7",
"electron-builder": "22.10.5",
"electron-builder-notarize": "^1.2.0",
"electron-devtools-installer": "^3.2.0",
Expand Down
6 changes: 4 additions & 2 deletions src/main/ui/WindowManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const defaultBrowserOptions = {
show: false,
width: 1024,
height: 768,
vibrancy: 'ultra-dark',
visualEffectState: 'active',
backgroundColor: is.macOS() ? '#00000000' : '#FFF',
webPreferences: {
nodeIntegration: true
}
Expand Down Expand Up @@ -87,8 +90,7 @@ export default class WindowManager extends EventEmitter {
contextIsolation: false,
nodeIntegration: true,
nodeIntegrationInWorker: true
},
hasShadow: !is.macOS()
}
})

const bounds = this.getPageBounds(page)
Expand Down
9 changes: 8 additions & 1 deletion src/renderer/components/Aside/Index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<el-aside width="78px" :class="['aside', 'hidden-sm-and-down', { 'draggable': asideDraggable }]">
<el-aside width="78px" :class="['aside', 'hidden-sm-and-down', { 'draggable': asideDraggable }]" :style="vibrancy">
<div class="aside-inner">
<mo-logo-mini />
<ul class="menu top-menu">
Expand Down Expand Up @@ -43,6 +43,13 @@
}),
asideDraggable () {
return is.macOS()
},
vibrancy () {
return is.macOS()
? {
backgroundColor: 'transparent'
}
: {}
}
},
methods: {
Expand Down
2 changes: 0 additions & 2 deletions src/renderer/pages/index/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import is from 'electron-is'
import { ipcRenderer } from 'electron'
import { getCurrentWindow } from '@electron/remote'
import Vue from 'vue'
import VueI18Next from '@panter/vue-i18next'
import { sync } from 'vuex-router-sync'
Expand Down Expand Up @@ -99,7 +98,6 @@ function init (config) {

setTimeout(() => {
loading.close()
getCurrentWindow().setHasShadow(true)
}, 400)
}

Expand Down