macOS vibrancy fixes

This commit is contained in:
Eugene Pankov 2022-01-30 20:43:59 +01:00
parent 109a83db5b
commit 75764cd725
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
7 changed files with 12 additions and 9 deletions

View file

@ -27,7 +27,7 @@ abstract class GlasstronWindow extends BrowserWindow {
abstract setBlur (_: boolean)
}
const macOSVibrancyType = process.platform === 'darwin' ? compareVersions(macOSRelease().version, '10.14', '>=') ? 'fullscreen-ui' : 'dark' : null
const macOSVibrancyType = process.platform === 'darwin' ? compareVersions(macOSRelease().version, '10.14', '>=') ? 'under-window' : 'dark' : null
const activityIcon = nativeImage.createFromPath(`${app.getAppPath()}/assets/activity.png`)

View file

@ -1,7 +1,7 @@
body {
min-height: 100vh;
overflow: hidden;
background: #1D272D;
background: transparent !important;
-webkit-font-smoothing: antialiased;
}

View file

@ -1,3 +1,7 @@
app-root {
background: #1D272D;
}
.preload-logo {
-webkit-app-region: drag;
position: fixed;

View file

@ -214,6 +214,10 @@ export class AppRootComponent {
}
}
@HostBinding('class.vibrant') get isVibrant () {
return this.config.store.appearance.vibrancy
}
private getToolbarButtons (aboveZero: boolean): ToolbarButton[] {
let buttons: ToolbarButton[] = []
this.config.enabledServices(this.toolbarButtonProviders).forEach(provider => {

View file

@ -117,15 +117,13 @@ window-controls {
$border-color: $base1;
body {
app-root {
background: $body-bg;
&.vibrant {
background: rgba(255, 255, 255,.4) !important;
}
}
app-root {
&> .content {
.tab-bar {
.btn-tab-bar {

View file

@ -25,15 +25,13 @@ window-controls {
$border-color: #111;
body {
app-root {
background: $body-bg;
&.vibrant {
background: rgba(0,0,0,.65);
}
}
app-root {
&.no-tabs {
background: rgba(0,0,0,.5);
}

View file

@ -116,7 +116,6 @@ export default class ElectronModule {
if (this.hostApp.platform === Platform.Windows && !isWindowsBuild(WIN_BUILD_FLUENT_BG_SUPPORTED)) {
vibrancyType = null
}
document.body.classList.toggle('vibrant', this.config.store.appearance.vibrancy)
this.electron.ipcRenderer.send('window-set-vibrancy', this.config.store.appearance.vibrancy, vibrancyType)
this.hostWindow.setOpacity(this.config.store.appearance.opacity)